Extended the range of the offset controls so that it now covers -750 to +750
authormleech <mleech@221aa14e-8319-0410-a670-987f0aec2ac5>
Mon, 30 Jul 2007 03:46:03 +0000 (03:46 +0000)
committermleech <mleech@221aa14e-8319-0410-a670-987f0aec2ac5>
Mon, 30 Jul 2007 03:46:03 +0000 (03:46 +0000)
Added bounds-checking/setting for both --calib_coeff and --calib_offset

git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6084 221aa14e-8319-0410-a670-987f0aec2ac5

gr-radio-astronomy/src/python/usrp_ra_receiver.py

index 95a9291f03a4ae3870fd08f603f046fdb0b9e83c..7a57d7e75b29e1231613f6bf3eb43def0bb2440b 100755 (executable)
@@ -148,7 +148,15 @@ class app_flow_graph(stdgui.gui_flow_graph):
         # Calibration coefficient and offset
         self.calib_coeff = options.calib_coeff
         self.calib_offset = options.calib_offset
-        self.orig_calib_offset = options.calib_offset
+        if self.calib_offset < -750:
+            self.calib_offset = -750
+        if self.calib_offset > 750:
+            self.calib_offset = 750
+
+        if self.calib_coeff < 1:
+            self.calib_offset = 1
+        if self.calib_coeff > 100:
+            self.calib_offset = 100
 
         self.integ = options.integ
         self.avg_alpha = options.avg
@@ -374,8 +382,8 @@ class app_flow_graph(stdgui.gui_flow_graph):
         self.integ = options.integ
         if self.setimode == False:
             self.myform['integration'].set_value(int(options.integ))
-            self.myform['offset'].set_value(options.calib_offset)
-            self.myform['dcgain'].set_value(options.calib_coeff)
+            self.myform['offset'].set_value(self.calib_offset)
+            self.myform['dcgain'].set_value(self.calib_coeff)
         self.myform['average'].set_value(int(options.avg))
 
 
@@ -521,7 +529,7 @@ class app_flow_graph(stdgui.gui_flow_graph):
 
         if self.setimode == False:
             myform['offset'] = form.slider_field(parent=self.panel, sizer=vbox3,
-                label="Post-Detector Offset", weight=1, min=-500, max=500, 
+                label="Post-Detector Offset", weight=1, min=-750, max=750, 
                 callback=self.set_pd_offset)
             vbox3.Add((2,0), 0, 0)
             myform['dcgain'] = form.slider_field(parent=self.panel, sizer=vbox3,