mirror of
https://github.com/janishutz/BiogasControllerApp.git
synced 2025-11-25 05:44:23 +00:00
Popups done, Readout Screen prepared, Small fixes
This commit is contained in:
107
biogascontrollerapp/gui/main/main.kv
Normal file
107
biogascontrollerapp/gui/main/main.kv
Normal 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}
|
||||
25
biogascontrollerapp/gui/main/main.py
Normal file
25
biogascontrollerapp/gui/main/main.py
Normal 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')
|
||||
Reference in New Issue
Block a user