Skip to content

Commit 27c9817

Browse files
Mark JessopMark Jessop
authored andcommitted
Emit warning message if radio dial cannot be parsed
1 parent c531572 commit 27c9817

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

horusgui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.3.13"
1+
__version__ = "0.3.14"

horusgui/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def read_config(widgets):
7676
""" Read in configuration settings from Qt """
7777
global qt_settings, default_config
7878

79-
OK_VERSIONS = [__version__, '0.3.12', '0.3.11', '0.3.10', '0.3.9', '0.3.8', '0.3.7', '0.3.6', '0.3.5', '0.3.4', '0.3.1', '0.2.1']
79+
OK_VERSIONS = [__version__, '0.3.13', '0.3.12', '0.3.11', '0.3.10', '0.3.9', '0.3.8', '0.3.7', '0.3.6', '0.3.5', '0.3.4', '0.3.1', '0.2.1']
8080

8181
# Try and read in the version parameter from QSettings
8282
if qt_settings.value("version") not in OK_VERSIONS:

horusgui/gui.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
widgets["dialFreqLabel"] = QtGui.QLabel("<b>Radio Dial Freq (MHz):</b>")
255255
widgets["dialFreqEntry"] = QtGui.QLineEdit("")
256256
widgets["dialFreqEntry"].setToolTip(
257-
"Optional entry of your radio's dial frequency in MHz.\n"\
257+
"Optional entry of your radio's dial frequency in MHz (e.g. 437.600).\n"\
258258
"Used to provide frequency information on SondeHub-Amateur."\
259259
)
260260

@@ -929,14 +929,19 @@ def handle_new_packet(frame):
929929

930930

931931
# Grab other metadata out of the GUI
932-
try:
933-
_radio_dial = float(widgets["dialFreqEntry"].text())*1e6
934-
if widgets["fest_float"]:
935-
# Add on the centre frequency estimation onto the dial frequency.
936-
_radio_dial += widgets["fest_float"]
932+
_radio_dial = None
937933

938-
except:
939-
_radio_dial = None
934+
if widgets["dialFreqEntry"].text() != "":
935+
try:
936+
_radio_dial = float(widgets["dialFreqEntry"].text())*1e6
937+
if widgets["fest_float"]:
938+
# Add on the centre frequency estimation onto the dial frequency.
939+
_radio_dial += widgets["fest_float"]
940+
941+
except:
942+
logging.warning("Could not parse radio dial frequency. This must be in MMM.KKK format e.g. 437.600")
943+
_radio_dial = None
944+
940945

941946
_baud_rate = int(widgets["horusModemRateSelector"].currentText())
942947
_modulation_detail = HORUS_MODEM_LIST[widgets["horusModemSelector"].currentText()]['modulation_detail']

0 commit comments

Comments
 (0)