Einige kleine Fixes und Ergänzungen
This commit is contained in:
		
							parent
							
								
									71b5f84a6f
								
							
						
					
					
						commit
						118b0d87ff
					
				| 
						 | 
					@ -0,0 +1,13 @@
 | 
				
			||||||
 | 
					Aufgaben- und Planungs- und Ideenliste
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Barograph
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Ankeralarm
 | 
				
			||||||
 | 
					  Kreis um Position, Liste letzter Positionen
 | 
				
			||||||
 | 
					  Tasten: Set/Clear, Radius+, Radius-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Satellitenübersicht / SkyView
 | 
				
			||||||
 | 
					  Kreis mit Sats
 | 
				
			||||||
 | 
					  Rechtecke mit SNR (Signal/Noise)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Sea wave recorder (siehe Steamrock)
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 5.4 KiB  | 
| 
						 | 
					@ -163,7 +163,7 @@ class HistoryBuffer():
 | 
				
			||||||
        ixnext = index + 1
 | 
					        ixnext = index + 1
 | 
				
			||||||
        if ixnext > self.size - 1:
 | 
					        if ixnext > self.size - 1:
 | 
				
			||||||
            ixnext = 0
 | 
					            ixnext = 0
 | 
				
			||||||
        return round((self.buf[ix] + self.buf[ixprev] + self.buf[ixnext]) / 3)
 | 
					        return round((self.buf[index] + self.buf[ixprev] + self.buf[ixnext]) / 3)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def setname(self, newname):
 | 
					    def setname(self, newname):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 1.8 KiB  | 
| 
						 | 
					@ -84,8 +84,8 @@ class Barograph(Page):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # Testausgabe der Datenerfassung
 | 
					            # Testausgabe der Datenerfassung
 | 
				
			||||||
            data = []
 | 
					            data = []
 | 
				
			||||||
            vmin = data[0]
 | 
					            vmin = 9999
 | 
				
			||||||
            vmax = data[0]
 | 
					            vmax = 0
 | 
				
			||||||
            i = self.series[self.zoomindex]
 | 
					            i = self.series[self.zoomindex]
 | 
				
			||||||
            for value in self.bd.history['press'].series[i].get():
 | 
					            for value in self.bd.history['press'].series[i].get():
 | 
				
			||||||
                v = value / 10
 | 
					                v = value / 10
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,6 +11,7 @@ TODO: Zeitzone anzeigen. Abhängig von Lat, Lon
 | 
				
			||||||
 | 
					
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
import cairo
 | 
					import cairo
 | 
				
			||||||
import math
 | 
					import math
 | 
				
			||||||
from .page import Page
 | 
					from .page import Page
 | 
				
			||||||
| 
						 | 
					@ -28,10 +29,11 @@ class Clock(Page):
 | 
				
			||||||
        self.utc = True
 | 
					        self.utc = True
 | 
				
			||||||
        self.location =  astral.Location(('Norderstedt', 'Germany', 53.710105, 10.0574378, 'UTC'))
 | 
					        self.location =  astral.Location(('Norderstedt', 'Germany', 53.710105, 10.0574378, 'UTC'))
 | 
				
			||||||
        self.location.astral = astral.Astral()
 | 
					        self.location.astral = astral.Astral()
 | 
				
			||||||
 | 
					        self.bgimg = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "unknown.png"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def handle_key(self, buttonid):
 | 
					    def handle_key(self, buttonid):
 | 
				
			||||||
        if buttonid == 1:
 | 
					        if buttonid == 1:
 | 
				
			||||||
            if self.modeindex < len(self.mode):
 | 
					            if self.modeindex < len(self.mode) - 1:
 | 
				
			||||||
                self.modeindex += 1
 | 
					                self.modeindex += 1
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                self.modeindex = 0
 | 
					                self.modeindex = 0
 | 
				
			||||||
| 
						 | 
					@ -45,22 +47,41 @@ class Clock(Page):
 | 
				
			||||||
        ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD)
 | 
					        ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # akuellen Modus anzeigen
 | 
					        # akuellen Modus anzeigen
 | 
				
			||||||
        if mode[modeindex] == 'A':
 | 
					        if self.mode[self.modeindex] == 'A':
 | 
				
			||||||
            self.draw_analog(ctx)
 | 
					            self.draw_analog(ctx)
 | 
				
			||||||
        if mode[modeindex] == 'D':
 | 
					        elif self.mode[self.modeindex] == 'D':
 | 
				
			||||||
            self.draw_digital(ctx)
 | 
					            self.draw_digital(ctx)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            self.draw_timer(ctx)
 | 
					            self.draw_timer(ctx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def draw_digital(self, ctx):
 | 
					    def draw_digital(self, ctx):
 | 
				
			||||||
        ctx.set_font_size(24)
 | 
					
 | 
				
			||||||
        ctx.move_to(10, 220)
 | 
					        ts = datetime.now()
 | 
				
			||||||
        ctx.show_text("Digital clock")
 | 
					
 | 
				
			||||||
 | 
					        ctx.set_font_size(20)
 | 
				
			||||||
 | 
					        ctx.move_to(10, 60)
 | 
				
			||||||
 | 
					        ctx.show_text("RTC")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ctx.select_font_face("DSEG7 Classic")
 | 
				
			||||||
 | 
					        ctx.set_font_size(80)
 | 
				
			||||||
 | 
					        # Zentrieren funktioniert nicht richtig, da der Leerraum vor der "1"
 | 
				
			||||||
 | 
					        # mitgerechnet wird. Dafür muß ggf. der Zeichensatz angepaßt werden.
 | 
				
			||||||
 | 
					        # self.draw_text_center(ctx, 200, 150, ts.strftime("%H:%M:%S"))
 | 
				
			||||||
 | 
					        ctx.move_to(-30, 200)
 | 
				
			||||||
 | 
					        ctx.show_text(ts.strftime("%H:%M:%S"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def draw_timer(self, ctx):
 | 
					    def draw_timer(self, ctx):
 | 
				
			||||||
 | 
					        ts = datetime.now()
 | 
				
			||||||
        ctx.set_font_size(24)
 | 
					        ctx.set_font_size(24)
 | 
				
			||||||
        ctx.move_to(10, 220)
 | 
					        ctx.move_to(10, 50)
 | 
				
			||||||
        ctx.show_text("Timer")
 | 
					        ctx.show_text("Race Timer")
 | 
				
			||||||
 | 
					        ctx.select_font_face("AtariST8x16SystemFont")
 | 
				
			||||||
 | 
					        ctx.set_font_size(16)
 | 
				
			||||||
 | 
					        self.draw_text_center(ctx, 200, 230, "Here be dragons")
 | 
				
			||||||
 | 
					        ctx.save()
 | 
				
			||||||
 | 
					        ctx.set_source_surface(self.bgimg, 140, 80)
 | 
				
			||||||
 | 
					        ctx.paint()
 | 
				
			||||||
 | 
					        ctx.restore()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def draw_analog(self, ctx):
 | 
					    def draw_analog(self, ctx):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue