Popups done, Readout Screen prepared, Small fixes

This commit is contained in:
2025-04-09 17:13:24 +02:00
parent 36a3079040
commit e0a54ac2bd
12 changed files with 248 additions and 46 deletions

View File

@@ -0,0 +1,107 @@
<MainScreen>:
on_pre_enter: root.reset()
name: "main"
canvas.before:
Color:
rgba: (50,50,50,0.2)
Rectangle:
size: self.size
pos: self.pos
GridLayout:
FloatLayout:
Label:
pos_hint: {"y":0.4}
text: "READOUT"
font_size: 40
color: (0, 113, 0, 1)
bold: True
GridLayout:
cols:4
size_hint: 0.8, 0.3
pos_hint: {"x":0.1, "y":0.4}
Label:
text: "SENSOR 1: "
font_size: 20
Label:
id: sonde1
text: ""
Label:
text: "SENSOR 2: "
font_size: 20
Label:
id: sonde2
text: ""
Label:
text: "SENSOR 3: "
font_size: 20
Label:
id: sonde3
text: ""
Label:
text: "SENSOR 4: "
font_size: 20
Label:
id: sonde4
text: ""
Button:
text: "Start communication"
size_hint: 0.2, 0.1
pos_hint: {"x": 0.5, "y": 0.05}
background_color: (255, 0, 0, 0.6)
on_release:
root.start()
Button:
text: "End communication"
size_hint: 0.2, 0.1
pos_hint: {"x": 0.7, "y": 0.05}
background_color: (255, 0, 0, 0.6)
on_release:
root.end()
Button:
text: "Back"
size_hint: 0.3, 0.1
pos_hint: {"x":0.05, "y":0.05}
background_color: (255, 0, 0, 0.6)
on_release:
root.end()
app.root.current = "home"
root.manager.transition.direction = "left"
ToggleButton:
id: mode_selector
size_hint: 0.15, 0.1
pos_hint: {"x":0.1, "y":0.2}
text: "Normal Mode" if self.state == "normal" else "Fast Mode"
on_text: root.switch_mode(mode_selector.text)
background_color: (255,0,0,0.6) if self.state == "normal" else (0,0,255,0.6)
Button:
text: "Read Data"
size_hint: 0.15, 0.1
pos_hint: {"x":0.3, "y":0.2}
background_color: (255, 0, 0, 0.6)
on_release:
root.end()
app.root.current = "read"
root.manager.transition.direction = "down"
Button:
text: "Temperature"
size_hint: 0.15, 0.1
pos_hint: {"x":0.5, "y":0.2}
background_color: (255, 0, 0, 0.6)
on_release:
root.end()
app.root.current = "temperature"
root.manager.transition.direction = "down"
Button:
text: "Change all Data"
size_hint: 0.15, 0.1
pos_hint: {"x":0.7, "y":0.2}
background_color: (255, 0, 0, 0.6)
on_release:
root.end()
app.root.current = "program"
root.manager.transition.direction = "down"
Label:
id: frequency
text: "Frequency will appear here"
font_size: 10
pos_hint: {"x":0.4, "y": 0.3}

View File

@@ -0,0 +1,25 @@
from kivy.uix.screenmanager import Screen
from kivy.lang import Builder
from lib.com import Com
class MainScreen(Screen):
def __init__(self, com: Com, **kw):
self._com = com;
super().__init__(**kw)
def start(self):
pass
def end(self):
pass
def reset(self):
pass
def back(self):
pass
Builder.load_file('./gui/main/main.kv')