NMEA0183 Empfangscode in entsprechendes Modul verlagert
This commit is contained in:
@@ -23,11 +23,15 @@ class Tracker(Page):
|
||||
self.bv_sog = boatdata.getRef("SOG")
|
||||
self.buttonlabel[1] = 'MODE'
|
||||
self.buttonlabel[2] = 'ON'
|
||||
self.mode = 'N' # (N)ormal, (C)onfiguration
|
||||
|
||||
def handle_key(self, buttonid):
|
||||
if buttonid == 1:
|
||||
|
||||
pass
|
||||
# Modus umschalten
|
||||
if self.mode == 'N':
|
||||
self.mode = 'C'
|
||||
else:
|
||||
self.mode = 'N'
|
||||
elif buttonid == 2:
|
||||
# Tracking ein/-ausschalten
|
||||
if self._appdata.track.is_active():
|
||||
@@ -37,7 +41,7 @@ class Tracker(Page):
|
||||
self._appdata.track.set_active(True)
|
||||
self.buttonlabel[2] = 'OFF'
|
||||
|
||||
def draw(self, ctx):
|
||||
def draw_normal(self, ctx):
|
||||
# Name
|
||||
ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD)
|
||||
ctx.set_font_size(32)
|
||||
@@ -66,11 +70,32 @@ class Tracker(Page):
|
||||
ctx.show_text("Sog=")
|
||||
ctx.show_text(self.bv_sog.format())
|
||||
|
||||
# Mögliche Regatten
|
||||
# Ausgewählte Regatta (raceid)
|
||||
x = 250
|
||||
y = 160
|
||||
y = 100
|
||||
ctx.move_to(x, y - 24)
|
||||
ctx.show_text("Regatten")
|
||||
ctx.show_text("Regatta: ")
|
||||
# if ...
|
||||
# else
|
||||
# "not selected"
|
||||
|
||||
def draw_config(self, ctx):
|
||||
ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD)
|
||||
ctx.set_font_size(32)
|
||||
ctx.move_to(20, 80)
|
||||
ctx.show_text("Tracker config")
|
||||
# Daten aus Konfiguration anzeigen
|
||||
# - boot
|
||||
# - tracker
|
||||
|
||||
ctx.set_font_size(16)
|
||||
|
||||
# Mögliche Regatten
|
||||
# -> auf Konfigurationsmodus verschieben
|
||||
x = 250
|
||||
y = 100
|
||||
ctx.move_to(x, y - 24)
|
||||
ctx.show_text("Regattas")
|
||||
for r in self._appdata.track.hero_get_races():
|
||||
ctx.move_to(x, y)
|
||||
ctx.show_text(r)
|
||||
@@ -78,4 +103,15 @@ class Tracker(Page):
|
||||
if y == 160:
|
||||
ctx.move_to(x, y)
|
||||
ctx.show_text("keine")
|
||||
|
||||
|
||||
|
||||
|
||||
ctx.move_to(20, 120)
|
||||
ctx.show_text("Type: ")
|
||||
ctx.show_text(self._appdata.track.ttype)
|
||||
|
||||
def draw(self, ctx):
|
||||
if self.mode == 'N':
|
||||
self.draw_normal(ctx)
|
||||
else:
|
||||
self.draw_config(ctx)
|
||||
|
||||
Reference in New Issue
Block a user