From 27c98174a0fc40cc8e24fd00ca95489b7e4e21bc Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Fri, 22 Sep 2023 14:15:25 +0930 Subject: [PATCH] Emit warning message if radio dial cannot be parsed --- horusgui/__init__.py | 2 +- horusgui/config.py | 2 +- horusgui/gui.py | 21 +++++++++++++-------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/horusgui/__init__.py b/horusgui/__init__.py index 8a3be2e..dc1bba8 100755 --- a/horusgui/__init__.py +++ b/horusgui/__init__.py @@ -1 +1 @@ -__version__ = "0.3.13" +__version__ = "0.3.14" diff --git a/horusgui/config.py b/horusgui/config.py index 301e141..827868a 100644 --- a/horusgui/config.py +++ b/horusgui/config.py @@ -76,7 +76,7 @@ def read_config(widgets): """ Read in configuration settings from Qt """ global qt_settings, default_config - 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'] + 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'] # Try and read in the version parameter from QSettings if qt_settings.value("version") not in OK_VERSIONS: diff --git a/horusgui/gui.py b/horusgui/gui.py index d5607d7..24e91f8 100644 --- a/horusgui/gui.py +++ b/horusgui/gui.py @@ -254,7 +254,7 @@ widgets["habitatUploadPosition"].setToolTip( widgets["dialFreqLabel"] = QtGui.QLabel("Radio Dial Freq (MHz):") widgets["dialFreqEntry"] = QtGui.QLineEdit("") widgets["dialFreqEntry"].setToolTip( - "Optional entry of your radio's dial frequency in MHz.\n"\ + "Optional entry of your radio's dial frequency in MHz (e.g. 437.600).\n"\ "Used to provide frequency information on SondeHub-Amateur."\ ) @@ -929,14 +929,19 @@ def handle_new_packet(frame): # Grab other metadata out of the GUI - try: - _radio_dial = float(widgets["dialFreqEntry"].text())*1e6 - if widgets["fest_float"]: - # Add on the centre frequency estimation onto the dial frequency. - _radio_dial += widgets["fest_float"] + _radio_dial = None - except: - _radio_dial = None + if widgets["dialFreqEntry"].text() != "": + try: + _radio_dial = float(widgets["dialFreqEntry"].text())*1e6 + if widgets["fest_float"]: + # Add on the centre frequency estimation onto the dial frequency. + _radio_dial += widgets["fest_float"] + + except: + logging.warning("Could not parse radio dial frequency. This must be in MMM.KKK format e.g. 437.600") + _radio_dial = None + _baud_rate = int(widgets["horusModemRateSelector"].currentText()) _modulation_detail = HORUS_MODEM_LIST[widgets["horusModemSelector"].currentText()]['modulation_detail']