Erstveröffentlichung Weihnachten 2024
This commit is contained in:
47
pages/threevalues.py
Normal file
47
pages/threevalues.py
Normal file
@@ -0,0 +1,47 @@
|
||||
import cairo
|
||||
from .page import Page
|
||||
|
||||
class ThreeValues(Page):
|
||||
|
||||
def __init__(self, pageno, cfg, boatdata, boatvalue1, boatvalue2, boatvalue3):
|
||||
super().__init__(pageno, cfg, boatdata)
|
||||
self.ref1 = self.bd.getRef(boatvalue1)
|
||||
self.ref2 = self.bd.getRef(boatvalue2)
|
||||
self.ref3 = self.bd.getRef(boatvalue3)
|
||||
|
||||
def draw(self, ctx):
|
||||
|
||||
# Seitenlayout
|
||||
ctx.rectangle(0, 105, 400, 3)
|
||||
ctx.rectangle(0, 195, 400, 3)
|
||||
ctx.fill()
|
||||
|
||||
ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD)
|
||||
|
||||
# Titel
|
||||
ctx.set_font_size(40)
|
||||
ctx.move_to(20, 55)
|
||||
ctx.show_text(self.ref1.valname)
|
||||
ctx.move_to(20, 145)
|
||||
ctx.show_text(self.ref2.valname)
|
||||
ctx.move_to(20, 235)
|
||||
ctx.show_text(self.ref3.valname)
|
||||
|
||||
# Einheiten
|
||||
ctx.set_font_size(24)
|
||||
ctx.move_to(20, 90)
|
||||
ctx.show_text(self.ref1.unit)
|
||||
ctx.move_to(20, 180)
|
||||
ctx.show_text(self.ref2.unit)
|
||||
ctx.move_to(20, 270)
|
||||
ctx.show_text(self.ref3.unit)
|
||||
|
||||
ctx.select_font_face("DSEG7 Classic")
|
||||
ctx.set_font_size(60)
|
||||
ctx.move_to(180, 90)
|
||||
ctx.show_text(self.ref1.format())
|
||||
ctx.move_to(180, 180)
|
||||
ctx.show_text(self.ref2.format())
|
||||
ctx.move_to(180, 270)
|
||||
ctx.show_text(self.ref3.format())
|
||||
ctx.stroke()
|
||||
Reference in New Issue
Block a user