From 7976342c36bad60511e6f643e3b18bd0d3dd3a2b Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sat, 19 Mar 2022 11:25:02 +1030 Subject: [PATCH] Add altitude field for better elevation calculations --- horusgui/__init__.py | 2 +- horusgui/config.py | 5 ++++- horusgui/gui.py | 25 +++++++++++++++---------- pyproject.toml | 2 +- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/horusgui/__init__.py b/horusgui/__init__.py index a8d4557..d7b30e1 100755 --- a/horusgui/__init__.py +++ b/horusgui/__init__.py @@ -1 +1 @@ -__version__ = "0.3.5" +__version__ = "0.3.6" diff --git a/horusgui/config.py b/horusgui/config.py index 18344dc..c0cec32 100644 --- a/horusgui/config.py +++ b/horusgui/config.py @@ -25,6 +25,7 @@ default_config = { "habitat_call": "N0CALL", "habitat_lat": 0.0, "habitat_lon": 0.0, + "habitat_alt": 0.0, "habitat_antenna": "", "habitat_radio": "", "horus_udp_enabled": True, @@ -72,7 +73,7 @@ def read_config(widgets): """ Read in configuration settings from Qt """ global qt_settings, default_config - OK_VERSIONS = [__version__, '0.3.4', '0.3.1', '0.2.1'] + OK_VERSIONS = [__version__, '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: @@ -93,6 +94,7 @@ def read_config(widgets): widgets["userCallEntry"].setText(str(default_config["habitat_call"])) widgets["userLatEntry"].setText(str(default_config["habitat_lat"])) widgets["userLonEntry"].setText(str(default_config["habitat_lon"])) + widgets["userAltEntry"].setText(str(default_config["habitat_alt"])) widgets["userAntennaEntry"].setText(str(default_config["habitat_antenna"])) widgets["userRadioEntry"].setText(str(default_config["habitat_radio"])) @@ -148,6 +150,7 @@ def save_config(widgets): default_config["habitat_call"] = widgets["userCallEntry"].text() default_config["habitat_lat"] = float(widgets["userLatEntry"].text()) default_config["habitat_lon"] = float(widgets["userLonEntry"].text()) + default_config["habitat_alt"] = float(widgets["userAltEntry"].text()) default_config["habitat_antenna"] = widgets["userAntennaEntry"].text() default_config["habitat_radio"] = widgets["userRadioEntry"].text() default_config["horus_udp_enabled"] = widgets["horusUploadSelector"].isChecked() diff --git a/horusgui/gui.py b/horusgui/gui.py index bf53148..2f5f6ff 100644 --- a/horusgui/gui.py +++ b/horusgui/gui.py @@ -232,6 +232,9 @@ widgets["userLatEntry"] = QtGui.QLineEdit("0.0") widgets["userLatEntry"].setToolTip("Station Latitude in Decimal Degrees, e.g. -34.123456") widgets["userLonEntry"] = QtGui.QLineEdit("0.0") widgets["userLonEntry"].setToolTip("Station Longitude in Decimal Degrees, e.g. 138.123456") +widgets["userAltitudeLabel"] = QtGui.QLabel("Altitude:") +widgets["userAltEntry"] = QtGui.QLineEdit("0.0") +widgets["userAltEntry"].setToolTip("Station Altitude in Metres Above Sea Level.") widgets["userAntennaLabel"] = QtGui.QLabel("Antenna:") widgets["userAntennaEntry"] = QtGui.QLineEdit("") widgets["userAntennaEntry"].setToolTip("A text description of your station's antenna.") @@ -265,15 +268,17 @@ w1_habitat.addWidget(widgets["userCallEntry"], 2, 1, 1, 2) w1_habitat.addWidget(widgets["userLocationLabel"], 3, 0, 1, 1) w1_habitat.addWidget(widgets["userLatEntry"], 3, 1, 1, 1) w1_habitat.addWidget(widgets["userLonEntry"], 3, 2, 1, 1) -w1_habitat.addWidget(widgets["userAntennaLabel"], 4, 0, 1, 1) -w1_habitat.addWidget(widgets["userAntennaEntry"], 4, 1, 1, 2) -w1_habitat.addWidget(widgets["userRadioLabel"], 5, 0, 1, 1) -w1_habitat.addWidget(widgets["userRadioEntry"], 5, 1, 1, 2) -w1_habitat.addWidget(widgets["dialFreqLabel"], 6, 0, 1, 1) -w1_habitat.addWidget(widgets["dialFreqEntry"], 6, 1, 1, 2) -w1_habitat.addWidget(widgets["habitatUploadPosition"], 7, 0, 1, 3) -w1_habitat.layout.setRowStretch(8, 1) -w1_habitat.addWidget(widgets["saveSettingsButton"], 9, 0, 1, 3) +w1_habitat.addWidget(widgets["userAltitudeLabel"], 4, 0, 1, 1) +w1_habitat.addWidget(widgets["userAltEntry"], 4, 1, 1, 2) +w1_habitat.addWidget(widgets["userAntennaLabel"], 5, 0, 1, 1) +w1_habitat.addWidget(widgets["userAntennaEntry"], 5, 1, 1, 2) +w1_habitat.addWidget(widgets["userRadioLabel"], 6, 0, 1, 1) +w1_habitat.addWidget(widgets["userRadioEntry"], 6, 1, 1, 2) +w1_habitat.addWidget(widgets["dialFreqLabel"], 7, 0, 1, 1) +w1_habitat.addWidget(widgets["dialFreqEntry"], 7, 1, 1, 2) +w1_habitat.addWidget(widgets["habitatUploadPosition"], 8, 0, 1, 3) +w1_habitat.layout.setRowStretch(9, 1) +w1_habitat.addWidget(widgets["saveSettingsButton"], 10, 0, 1, 3) d0_habitat.addWidget(w1_habitat) @@ -892,7 +897,7 @@ def handle_new_packet(frame): try: _station_lat = float(widgets["userLatEntry"].text()) _station_lon = float(widgets["userLonEntry"].text()) - _station_alt = 0.0 + _station_alt = float(widgets["userAltEntry"].text()) if (_station_lat != 0.0) or (_station_lon != 0.0): _position_info = position_info( diff --git a/pyproject.toml b/pyproject.toml index b9ab418..326e4e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "horusgui" -version = "0.3.5" +version = "0.3.6" description = "" authors = ["Mark Jessop "]