From 7d999988bea7dc30bed6c979ee00b994303b28e7 Mon Sep 17 00:00:00 2001 From: janis Date: Fri, 13 May 2022 19:30:12 +0200 Subject: [PATCH 1/2] Added logger & settings.ini file --- BiogasControllerApp-V2.2/bin/gui/gui.kv | 11 +- .../biogascontrollerapp.py | 141 ++++++++++++++---- BiogasControllerApp-V2.2/config/settings.ini | 18 +++ 3 files changed, 132 insertions(+), 38 deletions(-) create mode 100644 BiogasControllerApp-V2.2/config/settings.ini diff --git a/BiogasControllerApp-V2.2/bin/gui/gui.kv b/BiogasControllerApp-V2.2/bin/gui/gui.kv index 15ea7d1..7053162 100644 --- a/BiogasControllerApp-V2.2/bin/gui/gui.kv +++ b/BiogasControllerApp-V2.2/bin/gui/gui.kv @@ -215,7 +215,7 @@ RootScreen: on_release: root.exitapp() Label: - text: "You are currently running Version 2.2.0 - If you encounter a bug, please report it!" + text: "You are currently running Version 2.3.0 - If you encounter a bug, please report it!" font_size: 13 pos_hint: {"y": -0.45, "x":0.05} Button: @@ -404,7 +404,6 @@ RootScreen: Rectangle: size: self.size pos: self.pos - GridLayout: FloatLayout: Label: text: "Change Temperature" @@ -452,7 +451,7 @@ RootScreen: 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" + text: "Full\nreprogramming" if self.state == "normal" else "Partial\nreprogramming" on_release: root.change_mode() background_color: (255,0,0,0.6) if self.state == "normal" else (0,0,255,0.6) Button: @@ -591,7 +590,7 @@ RootScreen: 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" + text: "Full\nreprogramming" if self.state == "normal" else "Partial\nreprogramming" on_release: root.change_mode() background_color: (255,0,0,0.6) if self.state == "normal" else (0,0,255,0.6) Button: @@ -626,7 +625,7 @@ RootScreen: Label: text: "This is a rework of the BiogasControllerApp V1, that was originally programmed by S. Reichmuth." Label: - text: "Written by: Janis Hutz\nDesigned by: Janis Hutz\nDesign language: Kivy" + text: "Written by: Janis Hutz\nDesigned by: Janis Hutz\nDesign language: Kivy" : on_pre_enter: self.config = root.read_config() @@ -662,7 +661,7 @@ RootScreen: root.issue_reporting() ToggleButton: id: prsel - text: "Easy\nreprogramming" if self.state == "normal" else "Advanced\nreprogramming" + text: "Full\nreprogramming" if self.state == "normal" else "Partial\nreprogramming" on_release: root.change_programming() background_color: (255,0,0,0.6) if self.state == "normal" else (0,0,255,0.6) Button: diff --git a/BiogasControllerApp-V2.2/biogascontrollerapp.py b/BiogasControllerApp-V2.2/biogascontrollerapp.py index 43bd806..10916f7 100644 --- a/BiogasControllerApp-V2.2/biogascontrollerapp.py +++ b/BiogasControllerApp-V2.2/biogascontrollerapp.py @@ -1,32 +1,47 @@ -print(""" +import os +os.environ["KIVY_NO_CONSOLELOG"] = "1" -===================== - -BIOGASCONTROLLERAPP - ----------- -Version 2.2 -Copyright 2022 J.Hutz""") import time import threading import platform -import os import webbrowser -os.environ["KIVY_NO_CONSOLELOG"] = "1" from kivy.uix.screenmanager import Screen, ScreenManager from kivy.uix.popup import Popup from kivy.app import App from kivy.lang import Builder -from kivy.clock import mainthread +from kivy.clock import mainthread, Clock import bin.lib.lib import bin.lib.communication import bin.lib.comport_search import bin.lib.csv_parsers +import logging +import configparser +import datetime +import time + + +################################################################ +# LOGGER SETUP +################## +logging.basicConfig(level=logging.DEBUG, filename="./log/main_log.log", filemode="w") +logs = f"./log/{datetime.datetime.now()}-log-main.log" +logger = logging.getLogger(__name__) +handler = logging.FileHandler(logs) +formatter = logging.Formatter("%(levelname)s - %(asctime)s - %(name)s: %(message)s -- %(lineno)d") +handler.setFormatter(formatter) +logger.addHandler(handler) + +logger.setLevel(logging.DEBUG) +logger.info("Logger initialized") +################################################################# cvr = bin.lib.csv_parsers.CsvRead() cvw = bin.lib.csv_parsers.CsvWrite() com = bin.lib.lib.Com() +logger.info("Started modules") + + ################################################################## # Popups ################################################################## @@ -35,6 +50,7 @@ com = bin.lib.lib.Com() class QuitPU(Popup): def quitapp(self): com.quitcom() + logger.debug("App stopped") class NoConnection(Popup): @@ -123,8 +139,9 @@ class HomeScreen(Screen): try: com.connect(19200, "") com.quitcom() - except: + except Exception as e: connected = 0 + logger.error(e) def tryconnection(self): try: @@ -133,8 +150,9 @@ class HomeScreen(Screen): self.connected = 1 self.manager.current = "Readout" self.manager.transition.direction = "right" - except: + except Exception as ex: self.connected = 0 + logger.error(f"COM_error: {ex}") self.open_popup() def open_popup(self): @@ -148,17 +166,21 @@ class HomeScreen(Screen): class ReadoutScreen(Screen): go = 1 + def start_com(self): self.comstart(1) + logger.info("Trying to start COM") def comstart(self, pu_on): try: com.connect(19200, "") self.go = 1 - except: + except Exception as e: self.go = 0 + logger.error(f"COM_error: {e}") if self.go == 1: + logger.debug("COM start success") self.parent.current = "Readout" if pu_on == 1: self.openstartpu() @@ -176,8 +198,8 @@ class ReadoutScreen(Screen): self.go = 0 try: self.communication.join() - except: - pass + except Exception as e: + logger.warning(f"COM_Close_Error: {e}") if pu_on == 1: self.openendpu() else: @@ -190,6 +212,7 @@ class ReadoutScreen(Screen): self.__x = "" self.__begin = time.time() self.go = 1 + logger.info("Starting COM_Hook") while self.__x != "\n": if time.time() - self.__begin > 5: self.go = 0 @@ -198,6 +221,7 @@ class ReadoutScreen(Screen): self.__x = com.decode_ascii(com.receive(1)) if self.go == 1: + logger.info("COM_Hook 1 success") while self.__level < 3: self.__x = com.decode_ascii(com.receive(1)) if self.__x == " ": @@ -213,9 +237,9 @@ class ReadoutScreen(Screen): else: self.__distance += 1 self.check = 1 + logger.info("COM_Hook successful") com.receive(5) else: - self.go = 0 self.check = 0 while self.go == 1: @@ -256,14 +280,20 @@ class ReadoutScreen(Screen): try: self.communication.join() com.quitcom() - except: - pass + logger.info("Mode_Switch successful") + except Exception as e: + if e == AttributeError: + logger.info("No running process found, continuing") + else: + logger.fatal(f"FATAL ERROR OCCURED, APP WILL LEAVE NOW: {e}") if text == "Normal Mode": bin.lib.communication.SwitchMode().disable_fastmode() else: bin.lib.communication.SwitchMode().enable_fastmode() + logger.info("Switched mode, restarting COM") self.openpupups() self.comstart(0) + logger.info("COM restarted successfully") @mainthread def change_screen(self, pos, value): @@ -276,6 +306,7 @@ class ReadoutScreen(Screen): elif pos == 4: self.ids.sonde4.text = value elif pos == 6: + logger.error("COM_fail") self.openconnectionfailpu() else: self.ids.frequency.text = value @@ -300,6 +331,7 @@ class ReadoutScreen(Screen): pass def leave_screen(self): + logger.info("Stopping COM") self.stopcom(0) def resscreen(self): @@ -312,11 +344,13 @@ class ReadoutScreen(Screen): class Program(Screen): def read_config(self): + logger.debug("Reading config") self.config_imp = [] self.__export = [] self.config_imp = cvr.importing("./config/config.csv") self.__export = self.config_imp.pop(0) self.__extracted = self.__export.pop(0) + logger.debug(f"config {self.__extracted}") if self.__extracted == "1": self.ids.prsel.state = "normal" self.ids.s1_a.text = "" @@ -338,12 +372,14 @@ class Program(Screen): self.__mode = 1 else: self.ids.prsel.state = "down" - self.read_data() + Clock.schedule_once(self.read_data()) self.__mode = 2 def change_mode(self): + logger.info("Changing mode") + logger.debug(f"mode was: {self.__mode}") if self.__mode == "1": - self.read_data() + Clock.schedule_once(self.read_data()) self.__mode = 2 else: self.ids.s1_a.text = "" @@ -368,14 +404,16 @@ class Program(Screen): try: com.connect(19200, "") self.go = 1 - except: + except Exception as e: self.go = 0 + logger.error(f"COM_error: {e}") if self.go == 1: + logger.info("Sending instructions") com.send("RD") self.__pos = 1 self.__beginning = time.time() - self.go = 1 + logger.info("Awaiting confirmation from the microcontroller for hook") while True: if time.time() - self.__beginning < 5: self.__data_recieve = com.decode_ascii(com.receive(1)) @@ -387,6 +425,7 @@ class Program(Screen): self.__data_recieve = com.decode_ascii(com.receive(1)) if self.__data_recieve == "\n": self.go = 1 + logger.info("Hook successful") break else: pass @@ -398,6 +437,7 @@ class Program(Screen): pass else: self.go = 0 + logger.error("Microcontroller not available, stopping connection") break if self.go == 1: for i in range(4): @@ -427,6 +467,7 @@ class Program(Screen): self.ids.s4_c.text = self.__c self.ids.s4_t.text = self.__temp self.__pos += 1 + logger.info("Recieved info from microcontroller") else: self.open_confail_pu() com.quitcom() @@ -440,10 +481,12 @@ class Program(Screen): try: self.create_com() self.go = 1 - except: + except Exception as e: self.go = 0 + logger.critical(f"TRANSMISSION_Error: {e}") if self.go == 1: + logger.info("Preparing data to be sent") self.__transmit = [] if self.ids.s1_a.text != "" and self.ids.s1_b.text != "" and self.ids.s1_c.text != "" and self.ids.s1_t.text != "" and self.ids.s2_a.text != "" and self.ids.s2_b.text != "" and self.ids.s2_c.text != "" and self.ids.s2_t.text != "" and self.ids.s3_a.text != "" and self.ids.s3_b.text != "" and self.ids.s3_c.text != "" and self.ids.s3_t.text != "" and self.ids.s4_a.text != "" and self.ids.s4_b.text != "" and self.ids.s4_c.text != "" and self.ids.s4_t.text != "": self.__transmit.append(self.ids.s1_a.text) @@ -462,8 +505,11 @@ class Program(Screen): self.__transmit.append(self.ids.s4_b.text) self.__transmit.append(self.ids.s4_c.text) self.__transmit.append(self.ids.s4_t.text) + logger.debug("trying to send...") try: self.coms.change_all(self.__transmit, "") + logger.info("Transmission successful") + logger.debug("purging fields...") self.ids.s1_a.text = "" self.ids.s1_b.text = "" self.ids.s1_c.text = "" @@ -481,8 +527,9 @@ class Program(Screen): self.ids.s4_c.text = "" self.ids.s4_t.text = "" self.openconfpu() - except: + except Exception as e: self.open_confail_pu() + logger.critical(f"TRANSMITION_Error: {e}") else: self.openerrorpu() else: @@ -503,11 +550,13 @@ class Program(Screen): class ProgramTemp(Screen): def read_config(self): + logger.debug("Reading config") self.config_imp = [] self.__export = [] self.config_imp = cvr.importing("./config/config.csv") self.__export = self.config_imp.pop(0) self.__extracted = self.__export.pop(0) + logger.debug(f"Mode set is: {self.__extracted}") if self.__extracted == "1": self.ids.prsel.state = "normal" self.ids.temp_s1.text = "" @@ -517,12 +566,13 @@ class ProgramTemp(Screen): self.__mode = 1 else: self.ids.prsel.state = "down" - self.read_data() + Clock.schedule_once(self.read_data()) self.__mode = 2 def change_mode(self): + logger.info(f"Mode was: {self.__mode}") if self.__mode == "1": - self.read_data() + Clock.schedule_once(self.read_data()) self.__mode = 2 else: self.ids.temp_s1.text = "" @@ -532,17 +582,21 @@ class ProgramTemp(Screen): self.__mode = 1 def read_data(self): + logger.info("Trying to establish connection...") try: com.connect(19200, "") self.go = 1 - except: + except Exception as e: self.go = 0 + logger.error(f"COM_Error: {e}") if self.go == 1: + logger.info("Sending instructions to microcontroller...") com.send("RD") self.__pos = 1 self.__beginning = time.time() self.go = 1 + logger.info("Awaiting confirmation from the microcontroller for hook") while True: if time.time() - self.__beginning < 5: self.__data_recieve = com.decode_ascii(com.receive(1)) @@ -554,6 +608,7 @@ class ProgramTemp(Screen): self.__data_recieve = com.decode_ascii(com.receive(1)) if self.__data_recieve == "\n": self.go = 1 + logger.info("Hook successful") break else: pass @@ -565,8 +620,10 @@ class ProgramTemp(Screen): pass else: self.go = 0 + logger.error("Microcontroller not available, stopping connection") break if self.go == 1: + logger.info("Receiving data...") for i in range(4): self.__x = com.receive(28) self.__output = str(com.decode_float(self.__x[21:27])) @@ -579,6 +636,7 @@ class ProgramTemp(Screen): elif self.__pos == 4: self.ids.temp_s4.text = self.__output self.__pos += 1 + logger.info("Recieved data") else: self.open_confail_pu() com.quitcom() @@ -592,16 +650,19 @@ class ProgramTemp(Screen): try: self.create_com() self.go = 1 - except: + except Exception as e: self.go = 0 + logger.critical(f"COM_Error: Microcontroller unavailable: {e}") if self.go == 1: + logger.info("Preparing transmission...") self.__transmit = [] if self.ids.temp_s1.text != "" and self.ids.temp_s2.text != "" and self.ids.temp_s3.text != "" and self.ids.temp_s4.text != "": self.__transmit.append(self.ids.temp_s1.text) self.__transmit.append(self.ids.temp_s2.text) self.__transmit.append(self.ids.temp_s3.text) self.__transmit.append(self.ids.temp_s4.text) + logger.debug("Transmitting...") self.coms.change_temp(self.__transmit, "") self.ids.temp_s1.text = "" self.ids.temp_s2.text = "" @@ -610,6 +671,7 @@ class ProgramTemp(Screen): self.openconfpu() else: self.openerrorpu() + logger.debug("Missing fields") else: self.open_confail_pu() @@ -628,17 +690,21 @@ class ProgramTemp(Screen): class ReadData(Screen): def read_data(self): + logger.info("Trying to connect to the microcontroller") try: com.connect(19200, "") self.go = 1 - except: + except Exception as e: self.go = 0 + logger.error(f"COM_Error: {e}") if self.go == 1: + logger.info("Sending instructions to the microcontroller...") com.send("RD") self.__pos = 1 self.__beginning = time.time() self.go = 1 + logger.info("Awaiting confirmation from the microcontroller for hook") while True: if time.time() - self.__beginning < 5: self.__data_recieve = com.decode_ascii(com.receive(1)) @@ -650,6 +716,7 @@ class ReadData(Screen): self.__data_recieve = com.decode_ascii(com.receive(1)) if self.__data_recieve == "\n": self.go = 1 + logger.info("Hook successful") break else: pass @@ -661,8 +728,10 @@ class ReadData(Screen): pass else: self.go = 0 + logger.error("Microcontroller not available, stopping connection") break if self.go == 1: + logger.info("Receiving data") for i in range(4): self.__x = com.receive(28) self.__output = "a: " @@ -679,6 +748,7 @@ class ReadData(Screen): elif self.__pos == 4: self.ids.inf_sonde4.text = self.__output self.__pos += 1 + logger.info("Received data") else: self.open_confail_pu() com.quitcom() @@ -696,27 +766,32 @@ class Credits(Screen): class Modify(Screen): def read_config(self): + logger.debug("Reading config") self.config_imp = [] self.__export = [] self.config_imp = cvr.importing("./config/config.csv") self.__export = self.config_imp.pop(0) self.__extracted = self.__export.pop(0) + logger.debug(f"Mode at: {self.__extracted}") if self.__extracted == "1": self.ids.prsel.state = "normal" else: self.ids.prsel.state = "down" def issue_reporting(self): + logger.info("Clicked error reporting button") webbrowser.open("https://github.com/simplePCBuilding/BiogasControllerApp/issues", new=2) def change_programming(self): + logger.info("Switching programming mode") self.csv_import = [] self.csv_import = cvr.importing("./config/config.csv") self.csv_import.pop(0) - if self.ids.prsel.text == "Easy\nreprogramming": + if self.ids.prsel.text == "Full\nreprogramming": self.csv_import.insert(0, 1) else: self.csv_import.insert(0, 2) + logger.debug("Mode now:", self.csv_import) cvw.write_str("./config/config.csv", self.csv_import) @@ -730,7 +805,7 @@ class RootScreen(ScreenManager): kv = Builder.load_file("./bin/gui/gui.kv") - +logger.info("Loaded GUI") class BiogasControllerApp(App): def build(self): @@ -738,5 +813,7 @@ class BiogasControllerApp(App): return kv +logger.info("Init finished, starting UI") + if __name__ == "__main__": BiogasControllerApp().run() diff --git a/BiogasControllerApp-V2.2/config/settings.ini b/BiogasControllerApp-V2.2/config/settings.ini new file mode 100644 index 0000000..13f255c --- /dev/null +++ b/BiogasControllerApp-V2.2/config/settings.ini @@ -0,0 +1,18 @@ +[Port Settings] +forceSpecificPort: False +specificPort: None + +[UI Config] +sizeH: 600 +sizeW: 800 +showLoadingScreen: True + +[Dev Settings] +# Settings generally aimed towards the devs of this software! +verbose: False +log_level: DEBUG +disableConnectionCheck: False + +[Info] +version: V2.3.0 +subVersion: None \ No newline at end of file From 43687c7581481d3b4a60158d189860f8778cf87d Mon Sep 17 00:00:00 2001 From: janis Date: Sat, 14 May 2022 10:45:14 +0200 Subject: [PATCH 2/2] Implemented Settings and optimized logger --- BiogasControllerApp-V2.2/bin/gui/gui.kv | 10 +- .../biogascontrollerapp.py | 103 +++++++++++++----- BiogasControllerApp-V2.2/config/settings.ini | 18 ++- 3 files changed, 88 insertions(+), 43 deletions(-) diff --git a/BiogasControllerApp-V2.2/bin/gui/gui.kv b/BiogasControllerApp-V2.2/bin/gui/gui.kv index 7053162..b07f5ef 100644 --- a/BiogasControllerApp-V2.2/bin/gui/gui.kv +++ b/BiogasControllerApp-V2.2/bin/gui/gui.kv @@ -180,9 +180,8 @@ RootScreen: ###################################### # SCREENS ###################################### - : - name: "Home" + name: "HomeS" canvas.before: Color: rgba: (50,50,50,0.2) @@ -215,7 +214,8 @@ RootScreen: on_release: root.exitapp() Label: - text: "You are currently running Version 2.3.0 - If you encounter a bug, please report it!" + text: root.reset() + id: app_version font_size: 13 pos_hint: {"y": -0.45, "x":0.05} Button: @@ -294,7 +294,7 @@ RootScreen: background_color: (255, 0, 0, 0.6) on_release: root.leave_screen() - app.root.current = "Home" + app.root.current = "HomeS" root.manager.transition.direction = "left" ToggleButton: id: mode_sel @@ -652,7 +652,7 @@ RootScreen: text: "Back" background_color: (255,0,0,0.6) on_release: - app.root.current = "Home" + app.root.current = "HomeS" root.manager.transition.direction = "up" Button: text: "Report a\nBug" diff --git a/BiogasControllerApp-V2.2/biogascontrollerapp.py b/BiogasControllerApp-V2.2/biogascontrollerapp.py index 10916f7..017b566 100644 --- a/BiogasControllerApp-V2.2/biogascontrollerapp.py +++ b/BiogasControllerApp-V2.2/biogascontrollerapp.py @@ -1,11 +1,21 @@ import os -os.environ["KIVY_NO_CONSOLELOG"] = "1" +import configparser + +import serial + +config = configparser.ConfigParser() +config.read('./config/settings.ini') +co = config['Dev Settings']['verbose'] +if co == "True": + pass +else: + os.environ["KIVY_NO_CONSOLELOG"] = "1" -import time import threading import platform import webbrowser from kivy.uix.screenmanager import Screen, ScreenManager +from kivy.core.window import Window from kivy.uix.popup import Popup from kivy.app import App from kivy.lang import Builder @@ -15,10 +25,10 @@ import bin.lib.communication import bin.lib.comport_search import bin.lib.csv_parsers import logging -import configparser import datetime import time +version_app = f"{config['Info']['version']}{config['Info']['subVersion']}" ################################################################ # LOGGER SETUP @@ -31,14 +41,35 @@ formatter = logging.Formatter("%(levelname)s - %(asctime)s - %(name)s: %(message handler.setFormatter(formatter) logger.addHandler(handler) -logger.setLevel(logging.DEBUG) -logger.info("Logger initialized") +logger.setLevel(config['Dev Settings']['log_level']) +logger.info(f"Logger initialized, app is running Version: {version_app}") ################################################################# + cvr = bin.lib.csv_parsers.CsvRead() cvw = bin.lib.csv_parsers.CsvWrite() com = bin.lib.lib.Com() + +################################################################# +# Settings Handler +######################### +class SettingsHandler: + def __init__(self): + self.ports = None + self.window_sizeh = 600 + self.window_sizew = 800 + + def settingshandler(self): + self.ports = config['Port Settings']['specificPort'] + self.window_sizeh = config['UI Config']['sizeH'] + self.window_sizew = config['UI Config']['sizeW'] + Window.size = (int(self.window_sizew), int(self.window_sizeh)) + + +################################################################# + + logger.info("Started modules") @@ -133,15 +164,19 @@ class SaveConf(Popup): #################################################################### # SCREENS #################################################################### - class HomeScreen(Screen): - connected = 1 - try: - com.connect(19200, "") - com.quitcom() - except Exception as e: - connected = 0 - logger.error(e) + def reset(self): + logger.info("HomeScreen initialised") + SettingsHandler().settingshandler() + self.connected = 1 + self.info = f"You are currently running Version {version_app} - If you encounter a bug, please report it!" + try: + com.connect(19200, "") + com.quitcom() + except Exception as e: + self.connected = 0 + logger.error(e) + return self.info def tryconnection(self): try: @@ -151,9 +186,14 @@ class HomeScreen(Screen): self.manager.current = "Readout" self.manager.transition.direction = "right" except Exception as ex: - self.connected = 0 - logger.error(f"COM_error: {ex}") - self.open_popup() + if config['Dev Settings']['disableConnectionCheck'] == "True": + self.connected = 1 + self.manager.current = "Readout" + self.manager.transition.direction = "right" + else: + self.connected = 0 + logger.error(f"COM_error: {ex}") + self.open_popup() def open_popup(self): self.popups = NoConnection() @@ -280,20 +320,28 @@ class ReadoutScreen(Screen): try: self.communication.join() com.quitcom() + self.com_ok = 1 logger.info("Mode_Switch successful") except Exception as e: - if e == AttributeError: + if e == serial.SerialException: logger.info("No running process found, continuing") else: logger.fatal(f"FATAL ERROR OCCURED, APP WILL LEAVE NOW: {e}") - if text == "Normal Mode": - bin.lib.communication.SwitchMode().disable_fastmode() + self.com_ok = 0 + + if self.com_ok == 1: + if text == "Normal Mode": + bin.lib.communication.SwitchMode().disable_fastmode() + else: + bin.lib.communication.SwitchMode().enable_fastmode() + logger.info("Switched mode, restarting COM") + self.openpupups() + self.comstart(0) + logger.info("COM restarted successfully") else: - bin.lib.communication.SwitchMode().enable_fastmode() - logger.info("Switched mode, restarting COM") - self.openpupups() - self.comstart(0) - logger.info("COM restarted successfully") + self.check = 1 + self.ids.mode_sel.state = "normal" + self.openconnectionfailpu() @mainthread def change_screen(self, pos, value): @@ -335,6 +383,7 @@ class ReadoutScreen(Screen): self.stopcom(0) def resscreen(self): + logger.info("Screen reset") self.ids.sonde1.text = "" self.ids.sonde2.text = "" self.ids.sonde3.text = "" @@ -804,13 +853,11 @@ class RootScreen(ScreenManager): pass -kv = Builder.load_file("./bin/gui/gui.kv") -logger.info("Loaded GUI") - class BiogasControllerApp(App): def build(self): self.icon = "./BiogasControllerAppLogo.png" - return kv + self.title = "BiogasControllerApp" + return Builder.load_file("./bin/gui/gui.kv") logger.info("Init finished, starting UI") diff --git a/BiogasControllerApp-V2.2/config/settings.ini b/BiogasControllerApp-V2.2/config/settings.ini index 13f255c..20c6197 100644 --- a/BiogasControllerApp-V2.2/config/settings.ini +++ b/BiogasControllerApp-V2.2/config/settings.ini @@ -1,18 +1,16 @@ [Port Settings] -forceSpecificPort: False -specificPort: None +specificPort = None [UI Config] -sizeH: 600 -sizeW: 800 -showLoadingScreen: True +sizeH = 600 +sizeW = 800 [Dev Settings] # Settings generally aimed towards the devs of this software! -verbose: False -log_level: DEBUG -disableConnectionCheck: False +verbose = True +log_level = DEBUG +disableConnectionCheck = True [Info] -version: V2.3.0 -subVersion: None \ No newline at end of file +version = V2.3.0 +subVersion = -dev1