Kartenservice erstellt. Erster Test in der Ankerseite

This commit is contained in:
2025-10-26 18:45:49 +01:00
parent cd04a5560d
commit 1661c81dfa
3 changed files with 194 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ import math
import time
from cfgmenu import Menu
from .page import Page
from PIL import Image
class Anchor(Page):
@@ -44,7 +45,7 @@ class Anchor(Page):
self.buttonlabel[5] = '' # ALARM erst möglich wenn der Anker unten ist
self.mode = 'N' # (N)ormal, (C)onfiguration
self.scale = 50 # Radius of display circle in meter
self.scale = 425 # Radius of display circle in meter
self._bd = boatdata
@@ -68,6 +69,10 @@ class Anchor(Page):
self.alarm = False # Alarm ist ausgelöst und aktiv
self.wind_angle = -1
# Seekarte, mit Hintergrund wie das Display
self.app.mapsrv.set_output_size(260, 260)
self.bgimage = self.app.mapsrv.get_round_bwmap_cairo(53.56938345759218, 9.679658234303275, 15, (220, 220, 220))
# Menüsteuerung für Konfiguration
self._menu = Menu("Options", 20, 80)
self._menu.setItemDimension(120, 20)
@@ -179,6 +184,12 @@ class Anchor(Page):
# self.anchor_lat =
# Seekarte als Hintergrundbild
ctx.save()
ctx.set_source_surface(self.bgimage, (400 - 260) // 2, 20)
ctx.paint()
ctx.restore()
# Name
ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD)
ctx.set_font_size(20)