mirror of
https://github.com/janishutz/BiogasControllerApp.git
synced 2025-11-25 13:54:24 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f8fb015de3 | |||
| d1ba8d4d0e | |||
| 00773612c3 | |||
| bc39e7a50d |
@@ -1,5 +1,6 @@
|
|||||||
# -*- mode: python ; coding: utf-8 -*-
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
from kivy_deps import sdl2, glew
|
from kivy_deps import sdl2, glew
|
||||||
|
from kivymd import hooks_path as kivymd_hooks_path
|
||||||
|
|
||||||
block_cipher = None
|
block_cipher = None
|
||||||
|
|
||||||
@@ -10,7 +11,7 @@ a = Analysis(
|
|||||||
binaries=[],
|
binaries=[],
|
||||||
datas=[],
|
datas=[],
|
||||||
hiddenimports=[],
|
hiddenimports=[],
|
||||||
hookspath=[],
|
hookspath=[kivymd_hooks_path],
|
||||||
hooksconfig={},
|
hooksconfig={},
|
||||||
runtime_hooks=[],
|
runtime_hooks=[],
|
||||||
excludes=[],
|
excludes=[],
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# ╰────────────────────────────────────────────────╯
|
# ╰────────────────────────────────────────────────╯
|
||||||
#
|
#
|
||||||
# So you would like to read the source code? Nice!
|
# So you would like to read the source code? Nice!
|
||||||
#
|
#
|
||||||
# If you simply want to know how the connection stuff works, then head to
|
# If you simply want to know how the connection stuff works, then head to
|
||||||
# the util/ folder and check out the com.py file!
|
# the util/ folder and check out the com.py file!
|
||||||
#
|
#
|
||||||
@@ -28,7 +28,7 @@ print(
|
|||||||
━━━━━━━━━━━┏━┛┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┃┃━━┃┃━━
|
━━━━━━━━━━━┏━┛┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┃┃━━┃┃━━
|
||||||
━━━━━━━━━━━┗━━┛━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┗┛━━┗┛━━
|
━━━━━━━━━━━┗━━┛━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┗┛━━┗┛━━
|
||||||
|
|
||||||
Version 3.2.0
|
Version 3.2.2
|
||||||
|
|
||||||
=> Initializing....
|
=> Initializing....
|
||||||
"""
|
"""
|
||||||
@@ -36,6 +36,9 @@ print(
|
|||||||
|
|
||||||
# Load the config file
|
# Load the config file
|
||||||
import time
|
import time
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from kivy.resources import resource_add_path
|
||||||
from util.config import read_config, set_verbosity, str_to_bool
|
from util.config import read_config, set_verbosity, str_to_bool
|
||||||
|
|
||||||
verbose = str_to_bool(read_config("Dev", "verbose", "False", type_to_validate="bool"))
|
verbose = str_to_bool(read_config("Dev", "verbose", "False", type_to_validate="bool"))
|
||||||
@@ -186,7 +189,7 @@ class BiogasControllerApp(MDApp):
|
|||||||
print("\n", "-" * 20, "\n")
|
print("\n", "-" * 20, "\n")
|
||||||
|
|
||||||
self.icon = "./BiogasControllerAppLogo.png"
|
self.icon = "./BiogasControllerAppLogo.png"
|
||||||
self.title = "BiogasControllerApp-V3.2.0"
|
self.title = "BiogasControllerApp-V3.2.2"
|
||||||
self.screen_manager.add_widget(HomeScreen(com, name="home"))
|
self.screen_manager.add_widget(HomeScreen(com, name="home"))
|
||||||
self.screen_manager.add_widget(MainScreen(com, name="main"))
|
self.screen_manager.add_widget(MainScreen(com, name="main"))
|
||||||
self.screen_manager.add_widget(ProgramScreen(com, name="program"))
|
self.screen_manager.add_widget(ProgramScreen(com, name="program"))
|
||||||
@@ -204,5 +207,13 @@ if __name__ == "__main__":
|
|||||||
set_verbosity(verbose)
|
set_verbosity(verbose)
|
||||||
|
|
||||||
# Start the application
|
# Start the application
|
||||||
BiogasControllerApp().run()
|
try:
|
||||||
|
if hasattr(sys, "_MEIPASS"):
|
||||||
|
resource_add_path(os.path.join(sys._MEIPASS))
|
||||||
|
BiogasControllerApp().run()
|
||||||
|
except Exception as e:
|
||||||
|
print("Failed to run BiogasControllerApp!")
|
||||||
|
if verbose:
|
||||||
|
print(e)
|
||||||
|
input("Press enter to continue.")
|
||||||
print("\n => Exiting!")
|
print("\n => Exiting!")
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
***CHANGELOG***
|
***CHANGELOG***
|
||||||
|
V3.2.2
|
||||||
|
- Fix issues with Windows distributable: kivymd build
|
||||||
|
|
||||||
|
V3.2.1
|
||||||
|
- Fix issue with Windows distributable: kivymd not found
|
||||||
|
|
||||||
V3.2.0
|
V3.2.0
|
||||||
- Fixed a bug with comport assignment
|
- Fixed a bug with comport assignment
|
||||||
- Refactored some naming
|
- Refactored some naming
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
on_release: root.quit()
|
on_release: root.quit()
|
||||||
|
|
||||||
MDLabel:
|
MDLabel:
|
||||||
text: "You are running version V3.2.0"
|
text: "You are running version V3.2.2"
|
||||||
font_size: 13
|
font_size: 13
|
||||||
pos_hint: {"y": -0.45, "x":0}
|
pos_hint: {"y": -0.45, "x":0}
|
||||||
halign: 'center'
|
halign: 'center'
|
||||||
|
|||||||
@@ -47,11 +47,12 @@ def read_config(
|
|||||||
key_0: The first key (top level)
|
key_0: The first key (top level)
|
||||||
key_1: The second key (where the actual key-value pair is)
|
key_1: The second key (where the actual key-value pair is)
|
||||||
default: The default value to return if the check fails
|
default: The default value to return if the check fails
|
||||||
valid_entries: [Optiona] The entries that are valid ones to check against
|
valid_entries: [Optional] The entries that are valid ones to check against
|
||||||
type_to_validate: [Optional] Data type to validate
|
type_to_validate: [Optional] Data type to validate
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
[TODO:return]
|
The read config option as a string. You can cast this to the type you specified with type_to_validate safely.
|
||||||
|
When converting to a boolean though, use the str_to_bool function provided by this library
|
||||||
"""
|
"""
|
||||||
# Try loading the keys
|
# Try loading the keys
|
||||||
tmp = {}
|
tmp = {}
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ class Com(ControllerConnection):
|
|||||||
def __add_integer_as_hex(self, c: int):
|
def __add_integer_as_hex(self, c: int):
|
||||||
"""Writes the hexadecimal representation of the high and low bytes of integer `c` (16-bit) to the simulated serial port."""
|
"""Writes the hexadecimal representation of the high and low bytes of integer `c` (16-bit) to the simulated serial port."""
|
||||||
if not (0 <= c <= 0xFFFF):
|
if not (0 <= c <= 0xFFFF):
|
||||||
raise ValueError("Input must be a 16-bit integer (0–65535)")
|
raise ValueError("Input must be a 16-bit integer (0-65535)")
|
||||||
|
|
||||||
# Get high byte (most significant byte)
|
# Get high byte (most significant byte)
|
||||||
hi_byte = (c >> 8) & 0xFF
|
hi_byte = (c >> 8) & 0xFF
|
||||||
|
|||||||
Reference in New Issue
Block a user