45 lines
		
	
	
		
			963 B
		
	
	
	
		
			Python
		
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			963 B
		
	
	
	
		
			Python
		
	
	
	
| """
 | |
| WIP Mangels Generator keine Überprüfung möglich
 | |
| Dies ist im Prinzip ein Platzhalter
 | |
| 
 | |
| """
 | |
| 
 | |
| import cairo
 | |
| from .page import Page
 | |
| import math
 | |
| 
 | |
| class Generator(Page):
 | |
| 
 | |
|     def draw_generator(self, ctx, x, y, r):
 | |
|         ctx.set_line_width(4.0)
 | |
|         ctx.arc(x, y, r)
 | |
|         ctx.set_font_size(60)
 | |
|         self.draw_text_center(ctx, x, y, "G")
 | |
| 
 | |
|     def draw(self, ctx):
 | |
|         # Name
 | |
|         ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD)
 | |
|         ctx.set_font_size(40) 
 | |
|         ctx.move_to(10, 65)
 | |
|         ctx.show_text("Power")
 | |
|         ctx.move_to(12, 82)
 | |
|         ctx.show_text("Generator")
 | |
| 
 | |
|         # Voltage type
 | |
|         ctx.select_font_face("DSEG7 Classic")
 | |
|         ctx.move_to(10, 140)
 | |
|         # 12 or 24
 | |
|         ctx.show_text("12V")
 | |
| 
 | |
|         # Generator power
 | |
|         # kW or W
 | |
| 
 | |
|         # Show load level in percent
 | |
| 
 | |
|         # Show sensor type info
 | |
|         # INA219, INA226
 | |
| 
 | |
|         # Current, A
 | |
| 
 | |
|         # Consumption, W
 |