Compare commits

...

2 Commits

Author SHA1 Message Date
3b649f9c6a Remove extaneous line
I forgot to remove this when adding Intercom
2024-07-23 18:27:13 -07:00
12d6032e3a Ignore 0, 0 fixes 2024-07-23 18:21:14 -07:00

View File

@ -29,14 +29,15 @@ def main(port, intercom):
time = parsed_data.time time = parsed_data.time
date = parsed_data.date date = parsed_data.date
navpoint.content.content = f"""<?xml version='1.0' encoding='us-ascii'?><kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2"><Document><Style id="icon"><IconStyle><Icon><href>http://127.0.0.1:8888/marker.png</href></Icon></IconStyle></Style><name>Navpoint</name><open>1</open><Placemark><name>Position</name><styleUrl>#icon</styleUrl><Point><coordinates>{lon},{lat},0</coordinates></Point><description>{date} {time} UTC</description></Placemark></Document></kml>""" navpoint.content.content = f"""<?xml version='1.0' encoding='us-ascii'?><kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2"><Document><Style id="icon"><IconStyle><Icon><href>http://127.0.0.1:8888/marker.png</href></Icon></IconStyle></Style><name>Navpoint</name><open>1</open><Placemark><name>Position</name><styleUrl>#icon</styleUrl><Point><coordinates>{lon},{lat},0</coordinates></Point><description>{date} {time} UTC</description></Placemark></Document></kml>"""
intercom.put( if lat or lon: # ignore 0, 0 fixes
"LocationUpdate", intercom.put(
{ "LocationUpdate",
"lat": lat, {
"lon": lon, "lat": lat,
"time": f"{date} {time} UTC", "lon": lon,
}, "time": f"{date} {time} UTC",
) },
)
except AttributeError: except AttributeError:
pass pass
@ -45,7 +46,6 @@ def main(port, intercom):
"Disconnected", "Disconnected",
port, port,
) )
window.event_generate("<<newData>>", when="tail", state=1)
messagebox.showerror( messagebox.showerror(
"Navpoint Error", f"Error reading from port {port}: {str(e)}" "Navpoint Error", f"Error reading from port {port}: {str(e)}"
) )