Add plumbing enabling use of GnssShareNmeaSource

This commit is contained in:
Evangelos Ribeiro Tzaras 2022-08-26 17:48:49 +02:00
parent b76c8850c0
commit 78554c1afd

View file

@ -22,6 +22,7 @@ from .nmeasource import (
ModemError,
NmeaSourceNotFoundError,
QuectelNmeaSource,
GnssShareNmeaSource,
)
from .util import now, unique_filename, bearing_to_arrow
from .widgets import text_barchart, DataFrame
@ -222,7 +223,25 @@ class SatelliteApp(Gtk.Application):
return False # Remove from idle_add
def init_gnss_share_source(self):
return False
try:
self.source = GnssShareNmeaSource()
self.source.initialize()
except Exception as e:
fatal = False
dtext = 'Can you access "/var/run/gnss-share.sock"?'
dialog = Gtk.MessageDialog(
parent=self.window, modal=True,
message_type=Gtk.MessageType.ERROR,
buttons=Gtk.ButtonsType.OK, text=dtext)
dialog.set_title("Error initializing NMEA source")
dialog.run()
dialog.destroy()
if fatal:
self.quit()
return False
return True
def init_quectel_source(self):
try: