add IF and BB gain knobs to rx_gui

This commit is contained in:
Chris Kuethe 2015-05-10 15:32:36 -07:00
parent 7a55e7a643
commit 6108bf6ad1
2 changed files with 83 additions and 19 deletions

View File

@ -52,6 +52,8 @@ class mainwindow(QtGui.QMainWindow):
#should round to actual achieved gain #should round to actual achieved gain
self.ui.line_gain.insert(defaults["gain"]) self.ui.line_gain.insert(defaults["gain"])
self.ui.line_bb_gain.insert(defaults["bb_gain"])
self.ui.line_if_gain.insert(defaults["if_gain"])
#default to 5dB #default to 5dB
self.ui.line_threshold.insert(defaults["threshold"]) self.ui.line_threshold.insert(defaults["threshold"])
@ -143,6 +145,8 @@ class mainwindow(QtGui.QMainWindow):
#hook up parameter-changed signals so we can change gain, rate, etc. while running #hook up parameter-changed signals so we can change gain, rate, etc. while running
self.ui.combo_rate.currentIndexChanged['QString'].connect(self.update_sample_rate) self.ui.combo_rate.currentIndexChanged['QString'].connect(self.update_sample_rate)
self.ui.line_gain.editingFinished.connect(self.update_gain) self.ui.line_gain.editingFinished.connect(self.update_gain)
self.ui.line_bb_gain.editingFinished.connect(self.update_bb_gain)
self.ui.line_if_gain.editingFinished.connect(self.update_if_gain)
self.ui.combo_source.currentIndexChanged['QString'].connect(self.populate_source_options) self.ui.combo_source.currentIndexChanged['QString'].connect(self.populate_source_options)
#hook up live data text box update signal #hook up live data text box update signal
@ -161,6 +165,14 @@ class mainwindow(QtGui.QMainWindow):
if self.running: if self.running:
self._radio.set_gain(float(self.ui.line_gain.text())) self._radio.set_gain(float(self.ui.line_gain.text()))
def update_bb_gain(self):
if self.running:
self._radio.set_bb_gain(float(self.ui.line_bb_gain.text()))
def update_if_gain(self):
if self.running:
self._radio.set_if_gain(float(self.ui.line_if_gain.text()))
############ widget update functions for non-mapped widgets ############ ############ widget update functions for non-mapped widgets ############
def update_heading_widget(self, index): def update_heading_widget(self, index):
if index.model() is not None: if index.model() is not None:
@ -302,6 +314,8 @@ class mainwindow(QtGui.QMainWindow):
options.rate = float(self.ui.combo_rate.currentText()) * 1e6 options.rate = float(self.ui.combo_rate.currentText()) * 1e6
options.antenna = str(self.ui.combo_ant.currentText()) options.antenna = str(self.ui.combo_ant.currentText())
options.gain = float(self.ui.line_gain.text()) options.gain = float(self.ui.line_gain.text())
options.bb_gain = float(self.ui.line_bb_gain.text())
options.if_gain = float(self.ui.line_if_gain.text())
options.threshold = float(self.ui.line_threshold.text()) options.threshold = float(self.ui.line_threshold.text())
options.pmf = self.ui.check_pmf.isChecked() options.pmf = self.ui.check_pmf.isChecked()
options.dcblock = self.ui.check_dcblock.isChecked() options.dcblock = self.ui.check_dcblock.isChecked()
@ -387,6 +401,8 @@ class mainwindow(QtGui.QMainWindow):
self.prefs["samplerate"] = options.rate self.prefs["samplerate"] = options.rate
self.prefs["antenna"] = options.antenna self.prefs["antenna"] = options.antenna
self.prefs["gain"] = options.gain self.prefs["gain"] = options.gain
self.prefs["bb_gain"] = options.bb_gain
self.prefs["if_gain"] = options.if_gain
self.prefs["pmf"] = "1" if options.pmf else "0" self.prefs["pmf"] = "1" if options.pmf else "0"
self.prefs["dcblock"] = "1" if options.dcblock else "0" self.prefs["dcblock"] = "1" if options.dcblock else "0"
self.prefs["source"] = self.ui.combo_source.currentText() self.prefs["source"] = self.ui.combo_source.currentText()
@ -450,7 +466,9 @@ class mainwindow(QtGui.QMainWindow):
defaults["pmf"] = None defaults["pmf"] = None
defaults["dcblock"] = None defaults["dcblock"] = None
defaults["antenna"] = None defaults["antenna"] = None
defaults["gain"] = "25" defaults["gain"] = "10"
defaults["bb_gain"] = "20"
defaults["if_gain"] = "20"
defaults["kml"] = "1" defaults["kml"] = "1"
defaults["kmlfile"] = "modes.kml" defaults["kmlfile"] = "modes.kml"
defaults["sbs1"] = "0" defaults["sbs1"] = "0"

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>687</width> <width>687</width>
<height>422</height> <height>460</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -103,7 +103,7 @@
<x>10</x> <x>10</x>
<y>20</y> <y>20</y>
<width>236</width> <width>236</width>
<height>251</height> <height>300</height>
</rect> </rect>
</property> </property>
<property name="title"> <property name="title">
@ -210,7 +210,7 @@
<x>-1</x> <x>-1</x>
<y>117</y> <y>117</y>
<width>221</width> <width>221</width>
<height>71</height> <height>130</height>
</rect> </rect>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
@ -221,7 +221,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>90</x> <x>90</x>
<y>40</y> <y>100</y>
<width>121</width> <width>121</width>
<height>27</height> <height>27</height>
</rect> </rect>
@ -237,7 +237,27 @@
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_2"> <widget class="QLineEdit" name="line_bb_gain">
<property name="geometry">
<rect>
<x>90</x>
<y>40</y>
<width>71</width>
<height>27</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="line_if_gain">
<property name="geometry">
<rect>
<x>90</x>
<y>70</y>
<width>71</width>
<height>27</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_gain">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -247,10 +267,10 @@
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Gain</string> <string>RF Gain</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_bbgain">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -259,11 +279,37 @@
<height>17</height> <height>17</height>
</rect> </rect>
</property> </property>
<property name="text">
<string>BB Gain</string>
</property>
</widget>
<widget class="QLabel" name="label_ifgain">
<property name="geometry">
<rect>
<x>10</x>
<y>70</y>
<width>66</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>IF Gain</string>
</property>
</widget>
<widget class="QLabel" name="label_4antenna">
<property name="geometry">
<rect>
<x>10</x>
<y>100</y>
<width>66</width>
<height>17</height>
</rect>
</property>
<property name="text"> <property name="text">
<string>Antenna</string> <string>Antenna</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_18"> <widget class="QLabel" name="label_db">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>160</x> <x>160</x>
@ -307,7 +353,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>200</y> <y>270</y>
<width>221</width> <width>221</width>
<height>22</height> <height>22</height>
</rect> </rect>
@ -320,7 +366,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>220</y> <y>250</y>
<width>221</width> <width>221</width>
<height>22</height> <height>22</height>
</rect> </rect>
@ -947,7 +993,7 @@
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_8"> <layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QWebView" name="mapView" native="true"/> <widget class="QWebView" name="mapView"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -1032,13 +1078,19 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>687</width> <width>687</width>
<height>25</height> <height>27</height>
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QStatusBar" name="statusbar"/> <widget class="QStatusBar" name="statusbar"/>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header>QtWebKitWidgets/QWebView</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>QwtDial</class> <class>QwtDial</class>
<extends>QWidget</extends> <extends>QWidget</extends>
@ -1055,12 +1107,6 @@
<extends>QwtDial</extends> <extends>QwtDial</extends>
<header>qwt_compass.h</header> <header>qwt_compass.h</header>
</customwidget> </customwidget>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKit/qwebview.h</header>
<container>1</container>
</customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>
<connections/> <connections/>