Refactor for some name changes of libraries

This commit is contained in:
2025-06-22 13:22:14 +02:00
parent 4af20a9a91
commit efa6bca56c
14 changed files with 193 additions and 122 deletions

View File

@@ -40,7 +40,7 @@
on_release: root.quit()
MDLabel:
text: "You are running version V3.1.1"
text: "You are running version V3.2.0"
font_size: 13
pos_hint: {"y": -0.45, "x":0}
halign: 'center'

View File

@@ -4,9 +4,10 @@ from kivymd.uix.button import MDFlatButton
from kivymd.uix.dialog import MDDialog
from kivymd.uix.screen import MDScreen
from kivy.lang import Builder
from lib.com import ComSuperClass
import platform
from util.interface import ControllerConnection
# Information for errors encountered when using pyserial
information = {
@@ -25,7 +26,7 @@ information = {
# This is the launch screen, i.e. what you see when you start up the app
class HomeScreen(MDScreen):
def __init__(self, com: ComSuperClass, **kw):
def __init__(self, com: ControllerConnection, **kw):
self._com = com
self.connection_error_dialog = MDDialog(
title="Connection",

View File

@@ -10,9 +10,9 @@ import queue
import threading
# Load utilities
from lib.instructions import Instructions
from lib.com import ComSuperClass
from lib.decoder import Decoder
from util.instructions import Instructions
from util.interface import ControllerConnection
from util.decoder import Decoder
# TODO: Consider consolidating start and stop button
@@ -27,13 +27,13 @@ synced_queue: queue.Queue[List[str]] = queue.Queue()
# ╰────────────────────────────────────────────────╯
# Using a Thread to run this in parallel to the UI to improve responsiveness
class ReaderThread(threading.Thread):
_com: ComSuperClass
_com: ControllerConnection
_decoder: Decoder
_instructions: Instructions
# This method allows the user to set Com object to be used.
# The point of this is to allow for the use of a single Com object to not waste resources
def set_com(self, com: ComSuperClass):
def set_com(self, com: ControllerConnection):
"""Set the Com object to be used in this
Args:
@@ -106,7 +106,7 @@ class MainScreen(MDScreen):
# The constructor if this class takes a Com object to share one between all screens
# to preserve resources and make handling better
def __init__(self, com: ComSuperClass, **kw):
def __init__(self, com: ControllerConnection, **kw):
# Set some variables
self._com = com
self._event = None

View File

@@ -1,11 +1,11 @@
from typing import List
from kivymd.uix.screen import MDScreen
from kivy.lang import Builder
from lib.decoder import Decoder
from lib.instructions import Instructions
from util.decoder import Decoder
from util.instructions import Instructions
from util.instructions import ControllerConnection
from kivymd.uix.button import MDFlatButton
from kivymd.uix.dialog import MDDialog
from lib.com import ComSuperClass
from kivy.clock import Clock
@@ -15,7 +15,7 @@ name_map = ["a", "b", "c", "t"]
class ProgramScreen(MDScreen):
def __init__(self, com: ComSuperClass, **kw):
def __init__(self, com: ControllerConnection, **kw):
self._com = com
self._instructions = Instructions(com)
self._decoder = Decoder()