Bugfixing und einige Platzhalterseiten mit Daten gefüllt

This commit is contained in:
2025-10-07 11:19:08 +02:00
parent e7a2f4bb54
commit f969df8cb8
11 changed files with 146 additions and 84 deletions

View File

@@ -22,10 +22,10 @@ class FourValues(Page):
def __init__(self, pageno, cfg, appdata, boatdata, boatvalue1, boatvalue2, boatvalue3, boatvalue4):
super().__init__(pageno, cfg, appdata, boatdata)
self.value1 = boatvalue1
self.value2 = boatvalue2
self.value3 = boatvalue3
self.value4 = boatvalue4
self.ref1 = self.bd.getRef(boatvalue1)
self.ref2 = self.bd.getRef(boatvalue2)
self.ref3 = self.bd.getRef(boatvalue3)
self.ref4 = self.bd.getRef(boatvalue4)
def draw(self, ctx):
# Seitenunterteilung
@@ -34,42 +34,39 @@ class FourValues(Page):
ctx.rectangle(0, 214, 400, 3)
ctx.fill()
#
# Titel
ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD)
ctx.set_font_size(32)
ctx.move_to(20, 45)
ctx.show_text("AWA")
ctx.show_text(self.ref1.valname)
ctx.move_to(20, 113)
ctx.show_text("AWS")
ctx.show_text(self.ref2.valname)
ctx.move_to(20, 181)
ctx.show_text("COG")
ctx.show_text(self.ref3.valname)
ctx.move_to(20, 249)
ctx.show_text("STW")
ctx.stroke()
ctx.show_text(self.ref4.valname)
# Units
ctx.set_font_size(16)
ctx.move_to(20, 65)
ctx.show_text("Deg")
ctx.show_text(self.ref1.unit)
ctx.move_to(20, 133)
ctx.show_text("kn")
ctx.show_text(self.ref2.unit)
ctx.move_to(20, 201)
ctx.show_text("Deg")
ctx.show_text(self.ref3.unit)
ctx.move_to(20, 269)
ctx.show_text("kn")
ctx.stroke()
ctx.show_text(self.ref4.unit)
# Meßwerte
ctx.select_font_face("DSEG7 Classic")
ctx.set_font_size(40)
ctx.move_to(180, 65)
ctx.show_text("150")
ctx.show_text(self.ref1.format())
ctx.move_to(180, 133)
ctx.show_text("25.3")
ctx.show_text(self.ref2.format())
ctx.move_to(180, 201)
ctx.show_text("146")
ctx.show_text(self.ref3.format())
ctx.move_to(180, 269)
ctx.show_text("56.4")
ctx.show_text(self.ref4.format())
ctx.stroke()