Files
BiogasControllerApp/gui/main/main.kv

125 lines
3.5 KiB
Plaintext

<MainScreen>:
on_pre_enter: root.reset()
name: "main"
MDFloatLayout:
MDGridLayout:
cols: 1
pos_hint: {'x': 0, 'y': 0.4}
MDLabel:
text: "READOUT"
font_size: 40
halign: 'center'
valign: 'center'
pos_hint: {'center_x': 0, 'center_y': 0}
bold: True
MDGridLayout:
cols:4
size_hint: 0.8, 0.3
pos_hint: {"x":0.1, "y":0.4}
MDLabel:
text: "Sensor 1: "
font_size: 20
MDLabel:
id: sensor1
text: ""
size_hint: 1, 1
halign: 'left'
text_size: self.size
MDLabel:
text: "Sensor 2: "
font_size: 20
MDLabel:
id: sensor2
text: ""
size_hint: 1, 1
halign: 'left'
text_size: self.size
MDLabel:
text: "Sensor 3: "
font_size: 20
MDLabel:
id: sensor3
text: ""
size_hint: 1, 1
halign: 'left'
text_size: self.size
MDLabel:
text: "Sensor 4: "
font_size: 20
MDLabel:
id: sensor4
text: ""
size_hint: 1, 1
halign: 'left'
text_size: self.size
MDFillRoundFlatButton:
text: "Connect"
size_hint: 0.15, 0.09
pos_hint: {"x": 0.03, "y": 0.05}
on_release:
root.start()
MDFillRoundFlatButton:
text: "Disconnect"
size_hint: 0.15, 0.09
pos_hint: {"x": 0.2, "y": 0.05}
on_release:
root.end()
MDFillRoundFlatButton:
text: "Back"
size_hint: 0.15, 0.09
pos_hint: {"right": 0.95, "y":0.05}
md_bg_color: app.theme_cls.primary_dark
on_release:
root.end()
app.root.current = "home"
root.manager.transition.direction = "left"
MDGridLayout:
cols: 2
size_hint: 0.15, 0.1
pos_hint: {"x":0.1, "y":0.15}
MDLabel:
text: "Fast Mode"
valign: "center"
MDSwitch:
id: mode_selector
on_active: root.switch_mode()
icon_active: "check"
MDFillRoundFlatButton:
text: "Configuration"
size_hint: 0.1, 0.07
pos_hint: {"x":0.45, "y":0.06}
md_bg_color: app.theme_cls.accent_dark
on_release:
root.end()
app.root.current = "program"
root.manager.transition.direction = "down"
MDGridLayout:
size_hint: 0.2, None
spacing: 0
padding: 0
cols: 1
pos_hint: {'right': 0.95, 'top': 0.95}
MDLabel:
id: status
text: "Status will appear here"
font_size: 10
halign: 'right'
MDGridLayout:
size_hint: None, None
spacing: 0
padding: 0
cols: 1
pos_hint: {'right': 0.95, 'top': 0.925}
MDLabel:
id: port
text: "Port: Not connected"
font_size: 10
halign: 'right'