Erstveröffentlichung Weihnachten 2024

This commit is contained in:
2024-12-24 09:36:04 +01:00
commit 71b5f84a6f
81 changed files with 5728 additions and 0 deletions

31
pages/onevalue.py Normal file
View File

@@ -0,0 +1,31 @@
import cairo
from .page import Page
class OneValue(Page):
def __init__(self, pageno, cfg, boatdata, boatvalue):
super().__init__(pageno, cfg, boatdata)
self.ref1 = self.bd.getRef(boatvalue)
def draw(self, ctx):
# Bezeichnung
ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD)
ctx.set_font_size(60)
ctx.move_to(20, 100)
ctx.show_text(self.ref1.valname)
# Einheit
ctx.set_font_size(40)
ctx.move_to(270, 100)
ctx.show_text(self.ref1.unit)
# Meßwert
ctx.select_font_face("DSEG7 Classic")
ctx.set_font_size(100)
ctx.move_to(40, 240)
if self.ref1.value:
ctx.show_text(self.ref1.format())
else:
ctx.show_text(self.placeholder)
ctx.stroke()