From e59e087475dc08aa2e535b37f2b3eac24a0c2e25 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 27 Oct 2023 01:03:59 +0200 Subject: [PATCH] Added vertical distance --- sbapp/main.py | 5 ++++- sbapp/sideband/sense.py | 6 +++++- sbapp/ui/objectdetails.py | 11 +++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index 0a203bb..f3a4d40 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -1,4 +1,4 @@ -__debug_build__ = False +__debug_build__ = True __disable_shaders__ = False __version__ = "0.7.0" __variant__ = "beta" @@ -3605,6 +3605,9 @@ class SidebandApp(MDApp): self.map_action(direction="right") def object_details_action(self, sender=None, from_conv=False, from_telemetry=False, source_dest=None): + if self.sideband.config["telemetry_enabled"] == True: + self.sideband.update_telemetry() + self.root.ids.screen_manager.transition.direction = "left" self.root.ids.nav_drawer.set_state("closed") diff --git a/sbapp/sideband/sense.py b/sbapp/sideband/sense.py index d83d7ab..2c1ff09 100644 --- a/sbapp/sideband/sense.py +++ b/sbapp/sideband/sense.py @@ -782,8 +782,12 @@ class Location(Sensor): above_horizon = False srh = shared_radio_horizon(cs, cr) + if self.data["altitude"] != None and d["altitude"] != None: + dalt = salt-alt + else: + dalt = None - rendered["distance"] = {"euclidian": ed, "orthodromic": od} + rendered["distance"] = {"euclidian": ed, "orthodromic": od, "vertical": dalt} rendered["azalt"] = { "azimuth": aa[0], "altitude": aa[1], "above_horizon": above_horizon, "altitude_delta": atd, "local_angle_to_horizon": ath} diff --git a/sbapp/ui/objectdetails.py b/sbapp/ui/objectdetails.py index 888d8ea..67f951a 100644 --- a/sbapp/ui/objectdetails.py +++ b/sbapp/ui/objectdetails.py @@ -281,6 +281,17 @@ class RVDetails(MDRecycleView): if ed != None: ed_text = f"Euclidian distance [b]{RNS.prettydistance(ed)}[/b]" extra_entries.append({"icon": "axis-arrow", "text": ed_text}) + + if "vertical" in s["distance"]: + vd = s["distance"]["vertical"] + if vd != None: + if vd < 0: + relstr = "lower" + vd = abs(vd) + else: + relstr = "greater" + vd_text = f"Altitude is [b]{RNS.prettydistance(vd)}[/b] {relstr} than this device" + extra_entries.append({"icon": "altimeter", "text": vd_text}) if "angle_to_horizon" in s["values"]: oath = s["values"]["angle_to_horizon"]