Seite Tide vorbereitet für Wasserstandsvorhersagen

This commit is contained in:
2025-10-05 09:54:00 +02:00
parent fb7c688a99
commit e9d473fd10
3 changed files with 156 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ from .racetracker import RaceTracker
from .rollpitch import RollPitch
from .skyview import SkyView
from .solar import Solar
from .tide import Tide
from .rudder import Rudder
from .voltage import Voltage
from .wind import Wind

50
pages/tide.py Normal file
View File

@@ -0,0 +1,50 @@
"""
NAVTEX
- Meldungen anzeigen
"""
import cairo
from .page import Page
class Tide(Page):
def __init__(self, pageno, cfg, appdata, boatdata):
super().__init__(pageno, cfg, appdata, boatdata)
self.station = "f3c6ee73-5561-4068-96ec-364016e7d9ef" # Schulau
def draw(self, ctx):
# Title
ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD)
ctx.set_font_size(24)
ctx.move_to(8, 40)
ctx.show_text("Tide prediction")
ctx.set_font_size(16)
ctx.set_line_width(2)
x0 = 40 # links unten
y0 = 250
x1 = 380 # rechts oben
y1 = 60
# X-Achse
ctx.move_to(x0 + 0.5, y0 + 0.5)
ctx.line_to(x0 + 0.5, y1 + 0.5)
# self.draw_text_center(ctx, x0 - 20, y0 + (y1 -y0) / 2, "Höhe, cm", rotate=True)
self.draw_text_center(ctx, 60, 150, "Höhe, cm", rotate=True)
#self.draw_text_center(ctx, 100, 100, "Höhe, cm", rotate=False)
#ctx.move_to(90, 90) # Rotationsursprung
#ctx.line_to(110, 110)
#ctx.move_to(90, 110)
#ctx.line_to(110, 90)
#ctx.stroke()
# Y-Achse
ctx.move_to(x0 + 0.5, y0 + 0.5)
ctx.line_to(x1 + 0.5, y0 + 0.5)
self.draw_text_center(ctx, x0 + (x1 - x0) / 2, y0 + 12, "Zeit, h")
ctx.stroke()