commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4404 - gnuradio/branches/releases/3.0/gnuradio-core/s


From: jcorgan
Subject: [Commit-gnuradio] r4404 - gnuradio/branches/releases/3.0/gnuradio-core/src/lib/io
Date: Wed, 7 Feb 2007 11:06:50 -0700 (MST)

Author: jcorgan
Date: 2007-02-07 11:06:50 -0700 (Wed, 07 Feb 2007)
New Revision: 4404

Modified:
   gnuradio/branches/releases/3.0/gnuradio-core/src/lib/io/gr_oscope_guts.cc
Log:
Applied changeset r4151 on trunk to release branch.

Modified: 
gnuradio/branches/releases/3.0/gnuradio-core/src/lib/io/gr_oscope_guts.cc
===================================================================
--- gnuradio/branches/releases/3.0/gnuradio-core/src/lib/io/gr_oscope_guts.cc   
2007-02-07 17:58:14 UTC (rev 4403)
+++ gnuradio/branches/releases/3.0/gnuradio-core/src/lib/io/gr_oscope_guts.cc   
2007-02-07 18:06:50 UTC (rev 4404)
@@ -60,11 +60,11 @@
     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 @@
   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 @@
   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;
   }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]