diff --git a/BiogasControllerApp-V2.2/bin/gui/gui.kv b/BiogasControllerApp-V2.2/bin/gui/gui.kv index 569f292..15ea7d1 100644 --- a/BiogasControllerApp-V2.2/bin/gui/gui.kv +++ b/BiogasControllerApp-V2.2/bin/gui/gui.kv @@ -396,6 +396,7 @@ RootScreen: text: "" : + on_pre_enter: self.check_config = root.read_config() name: "PT" canvas.before: Color: @@ -441,12 +442,19 @@ RootScreen: input_filter: "float" Button: text: "Back" - size_hint: 0.2, 0.1 + size_hint: 0.1, 0.1 pos_hint: {"x":0.1, "y":0.1} background_color: (255, 0, 0, 0.6) on_release: app.root.current = "Readout" root.manager.transition.direction = "up" + ToggleButton: + id: prsel + size_hint: 0.2, 0.1 + pos_hint: {"x":0.35, "y": 0.1} + text: "Easy\nreprogramming" if self.state == "normal" else "Advanced\nreprogramming" + on_release: root.change_mode() + background_color: (255,0,0,0.6) if self.state == "normal" else (0,0,255,0.6) Button: text: "Save" size_hint: 0.2, 0.1 @@ -457,6 +465,7 @@ RootScreen: : name: "PR" + on_pre_enter: self.check_config = root.read_config() canvas.before: Color: rgba: (50,50,50,0.2) @@ -572,12 +581,19 @@ RootScreen: input_filter: "float" Button: text: "Back" - size_hint: 0.2, 0.1 + size_hint: 0.1, 0.1 pos_hint: {"x":0.1, "y":0.1} background_color: (255, 0, 0, 0.6) on_release: app.root.current = "Readout" root.manager.transition.direction = "up" + ToggleButton: + id: prsel + size_hint: 0.2, 0.1 + pos_hint: {"x":0.35, "y": 0.1} + text: "Easy\nreprogramming" if self.state == "normal" else "Advanced\nreprogramming" + on_release: root.change_mode() + background_color: (255,0,0,0.6) if self.state == "normal" else (0,0,255,0.6) Button: text: "Save" size_hint: 0.2, 0.1 @@ -586,6 +602,7 @@ RootScreen: on_release: root.send_data() + : name: "Credits" canvas.before: @@ -646,7 +663,7 @@ RootScreen: ToggleButton: id: prsel text: "Easy\nreprogramming" if self.state == "normal" else "Advanced\nreprogramming" - on_text: root.change_programming() + on_release: root.change_programming() background_color: (255,0,0,0.6) if self.state == "normal" else (0,0,255,0.6) Button: text: "Credits" diff --git a/BiogasControllerApp-V2.2/biogascontrollerapp.py b/BiogasControllerApp-V2.2/biogascontrollerapp.py index 80fbde1..43bd806 100644 --- a/BiogasControllerApp-V2.2/biogascontrollerapp.py +++ b/BiogasControllerApp-V2.2/biogascontrollerapp.py @@ -319,10 +319,23 @@ class Program(Screen): self.__extracted = self.__export.pop(0) if self.__extracted == "1": self.ids.prsel.state = "normal" - self.ids.temp_s1.text = "" - self.ids.temp_s2.text = "" - self.ids.temp_s3.text = "" - self.ids.temp_s4.text = "" + self.ids.s1_a.text = "" + self.ids.s1_b.text = "" + self.ids.s1_c.text = "" + self.ids.s1_t.text = "" + self.ids.s2_a.text = "" + self.ids.s2_b.text = "" + self.ids.s2_c.text = "" + self.ids.s2_t.text = "" + self.ids.s3_a.text = "" + self.ids.s3_b.text = "" + self.ids.s3_c.text = "" + self.ids.s3_t.text = "" + self.ids.s4_a.text = "" + self.ids.s4_b.text = "" + self.ids.s4_c.text = "" + self.ids.s4_t.text = "" + self.__mode = 1 else: self.ids.prsel.state = "down" self.read_data() @@ -330,15 +343,25 @@ class Program(Screen): def change_mode(self): if self.__mode == "1": - self.ids.prsel.state = "down" self.read_data() self.__mode = 2 else: - self.ids.prsel.state = "normal" - self.ids.temp_s1.text = "" - self.ids.temp_s2.text = "" - self.ids.temp_s3.text = "" - self.ids.temp_s4.text = "" + self.ids.s1_a.text = "" + self.ids.s1_b.text = "" + self.ids.s1_c.text = "" + self.ids.s1_t.text = "" + self.ids.s2_a.text = "" + self.ids.s2_b.text = "" + self.ids.s2_c.text = "" + self.ids.s2_t.text = "" + self.ids.s3_a.text = "" + self.ids.s3_b.text = "" + self.ids.s3_c.text = "" + self.ids.s3_t.text = "" + self.ids.s4_a.text = "" + self.ids.s4_b.text = "" + self.ids.s4_c.text = "" + self.ids.s4_t.text = "" self.__mode = 1 def read_data(self): @@ -405,14 +428,10 @@ class Program(Screen): self.ids.s4_t.text = self.__temp self.__pos += 1 else: - self.open_comfail_pu() + self.open_confail_pu() com.quitcom() else: - self.open_comfail_pu() - - def open_comfail_pu(self): - self.cfpu = ConnectionFail() - self.cfpu.open() + self.open_confail_pu() def create_com(self): self.coms = bin.lib.communication.Communication() @@ -495,6 +514,7 @@ class ProgramTemp(Screen): self.ids.temp_s2.text = "" self.ids.temp_s3.text = "" self.ids.temp_s4.text = "" + self.__mode = 1 else: self.ids.prsel.state = "down" self.read_data() @@ -502,11 +522,9 @@ class ProgramTemp(Screen): def change_mode(self): if self.__mode == "1": - self.ids.prsel.state = "down" self.read_data() self.__mode = 2 else: - self.ids.prsel.state = "normal" self.ids.temp_s1.text = "" self.ids.temp_s2.text = "" self.ids.temp_s3.text = "" @@ -562,14 +580,10 @@ class ProgramTemp(Screen): self.ids.temp_s4.text = self.__output self.__pos += 1 else: - self.open_comfail_pu() + self.open_confail_pu() com.quitcom() else: - self.open_comfail_pu() - - def open_comfail_pu(self): - self.cfpu = ConnectionFail() - self.cfpu.open() + self.open_confail_pu() def create_com(self): self.coms = bin.lib.communication.Communication()