Changeset 4151

Show
Ignore:
Timestamp:
12/19/06 13:22:25
Author:
eb
Message:

Real fix for ticket:104. I should have just applied it all the
first time around ;) Thanks Don for the patch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gnuradio/trunk/gnuradio-core/src/lib/io/gr_oscope_guts.cc

    r4150 r4151  
    6161    d_trigger_level (0), 
    6262    d_obi (0), 
    63     d_state (LOOK_FOR_TRIGGER), 
     63    d_state (HOLD_OFF), 
    6464    d_decimator_count (0), 
    6565    d_decimator_count_init (1), 
    6666    d_hold_off_count (0), 
    67     d_hold_off_count_init (0), 
     67    d_hold_off_count_init (OUTPUT_RECORD_SIZE/2-1), 
    6868    d_post_trigger_count (0), 
    6969    d_post_trigger_count_init (OUTPUT_RECORD_SIZE/2), 
     
    7878    d_buffer[i] = 0; 
    7979 
    80   for (int i = 0; i < d_nchannels; i++) 
     80  for (int i = 0; i < d_nchannels; i++){ 
    8181    d_buffer[i] = new float [OUTPUT_RECORD_SIZE]; 
    82  
     82    for (int j = 0; j < OUTPUT_RECORD_SIZE; j++) 
     83      d_buffer[i][j] = 0.0; 
     84  } 
     85 
     86  // be sure buffer is full before first write 
     87  enter_hold_off (); 
    8388  update_rate_or_decimation_changed (); 
    84   enter_look_for_trigger (); 
    8589} 
    8690 
     
    229233 
    230234  for (int ch = 0; ch < d_nchannels; ch++){ 
    231     // note that d_obi points at the oldest sample in the buffer 
     235    // note that d_obi + 1 points at the oldest sample in the buffer 
    232236    for (int i = 0; i < OUTPUT_RECORD_SIZE; i++) 
    233       out[i] = d_buffer[ch][wrap_bi(d_obi + i)]; 
     237      out[i] = d_buffer[ch][wrap_bi(d_obi + 1 + i)]; 
    234238 
    235239    out += OUTPUT_RECORD_SIZE;