X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnuradio-core%2Fsrc%2Flib%2Fio%2Fgr_oscope_guts.cc;h=286a7d1fb9abec1793801bd837184384df46c7b4;hb=b78ae1de4d9bbde942e5e7556630d7ccd8161c30;hp=2a152b95a20d402d2279234faeb1a0ee3dfdffa9;hpb=0cfd4875e519e2b1ee05d074f72ec67391ed13bf;p=debian%2Fgnuradio diff --git a/gnuradio-core/src/lib/io/gr_oscope_guts.cc b/gnuradio-core/src/lib/io/gr_oscope_guts.cc index 2a152b95..286a7d1f 100644 --- a/gnuradio-core/src/lib/io/gr_oscope_guts.cc +++ b/gnuradio-core/src/lib/io/gr_oscope_guts.cc @@ -60,11 +60,11 @@ gr_oscope_guts::gr_oscope_guts (int nchannels, double sample_rate, gr_msg_queue_ d_update_rate (20), d_trigger_level (0), d_obi (0), - d_state (LOOK_FOR_TRIGGER), + d_state (HOLD_OFF), d_decimator_count (0), d_decimator_count_init (1), d_hold_off_count (0), - d_hold_off_count_init (0), + d_hold_off_count_init (OUTPUT_RECORD_SIZE/2-1), d_post_trigger_count (0), d_post_trigger_count_init (OUTPUT_RECORD_SIZE/2), d_prev_sample (0) @@ -77,11 +77,15 @@ gr_oscope_guts::gr_oscope_guts (int nchannels, double sample_rate, gr_msg_queue_ for (int i = 0; i < MAX_CHANNELS; i++) d_buffer[i] = 0; - for (int i = 0; i < d_nchannels; i++) + for (int i = 0; i < d_nchannels; i++){ d_buffer[i] = new float [OUTPUT_RECORD_SIZE]; + for (int j = 0; j < OUTPUT_RECORD_SIZE; j++) + d_buffer[i][j] = 0.0; + } + // be sure buffer is full before first write + enter_hold_off (); update_rate_or_decimation_changed (); - enter_look_for_trigger (); } gr_oscope_guts::~gr_oscope_guts () @@ -228,9 +232,9 @@ gr_oscope_guts::write_output_records () float *out = (float *)msg->msg(); // get pointer to raw message buffer for (int ch = 0; ch < d_nchannels; ch++){ - // note that d_obi points at the oldest sample in the buffer + // note that d_obi + 1 points at the oldest sample in the buffer for (int i = 0; i < OUTPUT_RECORD_SIZE; i++) - out[i] = d_buffer[ch][wrap_bi(d_obi + i)]; + out[i] = d_buffer[ch][wrap_bi(d_obi + 1 + i)]; out += OUTPUT_RECORD_SIZE; }