Einige kleine Fixes und Ergänzungen
This commit is contained in:
parent
71b5f84a6f
commit
118b0d87ff
|
@ -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)
|
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
|
@ -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):
|
||||
"""
|
||||
|
|
2
obp60.py
2
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)
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
||||
|
|
Loading…
Reference in New Issue