diff --git a/TODO b/TODO new file mode 100644 index 0000000..a949def --- /dev/null +++ b/TODO @@ -0,0 +1,13 @@ +Aufgaben- und Planungs- und Ideenliste + +- Barograph + +- Ankeralarm + Kreis um Position, Liste letzter Positionen + Tasten: Set/Clear, Radius+, Radius- + +- Satellitenübersicht / SkyView + Kreis mit Sats + Rechtecke mit SNR (Signal/Noise) + +- Sea wave recorder (siehe Steamrock) diff --git a/images/unknown.png b/images/unknown.png new file mode 100644 index 0000000..8653563 Binary files /dev/null and b/images/unknown.png differ diff --git a/nmea2000/hbuffer.py b/nmea2000/hbuffer.py index 8198f0d..24f66aa 100644 --- a/nmea2000/hbuffer.py +++ b/nmea2000/hbuffer.py @@ -163,7 +163,7 @@ class HistoryBuffer(): ixnext = index + 1 if ixnext > self.size - 1: ixnext = 0 - return round((self.buf[ix] + self.buf[ixprev] + self.buf[ixnext]) / 3) + return round((self.buf[index] + self.buf[ixprev] + self.buf[ixnext]) / 3) def setname(self, newname): """ diff --git a/obp60.py b/obp60.py index 2385255..e5c66af 100755 --- a/obp60.py +++ b/obp60.py @@ -318,7 +318,7 @@ class Frontend(Gtk.Window): GLib.timeout_add_seconds(2, self.on_timer) self.show_all() Gtk.main() - + def on_timer(self): # Boatdata validator boatdata.updateValid(5) diff --git a/obp60_48x48.png b/obp60_48x48.png new file mode 100644 index 0000000..9157015 Binary files /dev/null and b/obp60_48x48.png differ diff --git a/pages/barograph.py b/pages/barograph.py index 6b50434..e97d50f 100644 --- a/pages/barograph.py +++ b/pages/barograph.py @@ -84,8 +84,8 @@ class Barograph(Page): # Testausgabe der Datenerfassung data = [] - vmin = data[0] - vmax = data[0] + vmin = 9999 + vmax = 0 i = self.series[self.zoomindex] for value in self.bd.history['press'].series[i].get(): v = value / 10 diff --git a/pages/clock.py b/pages/clock.py index e25144b..2df135e 100644 --- a/pages/clock.py +++ b/pages/clock.py @@ -11,6 +11,7 @@ TODO: Zeitzone anzeigen. Abhängig von Lat, Lon """ +import os import cairo import math from .page import Page @@ -28,10 +29,11 @@ class Clock(Page): self.utc = True self.location = astral.Location(('Norderstedt', 'Germany', 53.710105, 10.0574378, 'UTC')) self.location.astral = astral.Astral() + self.bgimg = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "unknown.png")) def handle_key(self, buttonid): if buttonid == 1: - if self.modeindex < len(self.mode): + if self.modeindex < len(self.mode) - 1: self.modeindex += 1 else: self.modeindex = 0 @@ -45,22 +47,41 @@ class Clock(Page): ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD) # akuellen Modus anzeigen - if mode[modeindex] == 'A': + if self.mode[self.modeindex] == 'A': self.draw_analog(ctx) - if mode[modeindex] == 'D': + elif self.mode[self.modeindex] == 'D': self.draw_digital(ctx) else: self.draw_timer(ctx) def draw_digital(self, ctx): - ctx.set_font_size(24) - ctx.move_to(10, 220) - ctx.show_text("Digital clock") + + ts = datetime.now() + + ctx.set_font_size(20) + ctx.move_to(10, 60) + ctx.show_text("RTC") + + ctx.select_font_face("DSEG7 Classic") + ctx.set_font_size(80) + # Zentrieren funktioniert nicht richtig, da der Leerraum vor der "1" + # mitgerechnet wird. Dafür muß ggf. der Zeichensatz angepaßt werden. + # self.draw_text_center(ctx, 200, 150, ts.strftime("%H:%M:%S")) + ctx.move_to(-30, 200) + ctx.show_text(ts.strftime("%H:%M:%S")) def draw_timer(self, ctx): + ts = datetime.now() ctx.set_font_size(24) - ctx.move_to(10, 220) - ctx.show_text("Timer") + ctx.move_to(10, 50) + ctx.show_text("Race Timer") + ctx.select_font_face("AtariST8x16SystemFont") + ctx.set_font_size(16) + self.draw_text_center(ctx, 200, 230, "Here be dragons") + ctx.save() + ctx.set_source_surface(self.bgimg, 140, 80) + ctx.paint() + ctx.restore() def draw_analog(self, ctx):