Erstveröffentlichung Weihnachten 2024
This commit is contained in:
31
pages/onevalue.py
Normal file
31
pages/onevalue.py
Normal 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()
|
||||
Reference in New Issue
Block a user