From 4505f90ef6f1a5d9bc28815c0500e821580a152e Mon Sep 17 00:00:00 2001 From: ATATC Date: Mon, 25 Dec 2023 16:14:13 -0500 Subject: [PATCH] Version `0.1.4`. --- leads_vec/__version__.py | 2 +- leads_vec/cli.py | 25 ++++++++++++++++--------- leads_vec/config.py | 3 +++ setup.py | 2 +- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/leads_vec/__version__.py b/leads_vec/__version__.py index 8a132aeb..855d3de5 100644 --- a/leads_vec/__version__.py +++ b/leads_vec/__version__.py @@ -1 +1 @@ -__version__: str = "3cb07775" +__version__: str = "99b51b9f" diff --git a/leads_vec/cli.py b/leads_vec/cli.py index 1ce4538b..7211c1e4 100644 --- a/leads_vec/cli.py +++ b/leads_vec/cli.py @@ -1,5 +1,5 @@ from datetime import datetime -from time import time +from time import time, sleep from PySimpleGUI import Button, Text from keyboard import add_hotkey @@ -73,17 +73,25 @@ def switch_atbs(): manager["atbs"] = Button(button_text="ATBS ON", key=switch_atbs, font=BODY, size=(round(manager.window().width() / 25.858585), None)) - uim = initialize(Window(720, 480, - config.refresh_rate, - CustomRuntimeData(), - fullscreen=False, - no_title_bar=False), render, context, main_controller) + uim = initialize( + Window(config.width, + config.height, + config.refresh_rate, + CustomRuntimeData(), + fullscreen=config.fullscreen, + no_title_bar=False), + render, + context, + main_controller) class CustomCallback(Callback): def on_fail(self, service: Service, error: Exception) -> None: uim.rd().comm = None - if uim.active(): - uim["comm_status"].update("COMM OFFLINE", text_color="gray") + for _ in range(30): + if uim.active(): + break + sleep(.1) + uim["comm_status"].update("COMM OFFLINE", text_color="gray") def on_receive(self, service: Service, msg: bytes) -> None: print(msg) @@ -135,7 +143,6 @@ def post_suspend(self, e: SuspensionEvent) -> None: ["dtcs_status", "abs_status", "ebi_status", "atbs_status", "comm_status"], ["dtcs", "abs", "ebi", "atbs"] ]) - add_hotkey("ctrl+e", uim.kill) uim.show() uim.rd().comm_kill() return 0 diff --git a/leads_vec/config.py b/leads_vec/config.py index 5babf695..beaca15d 100644 --- a/leads_vec/config.py +++ b/leads_vec/config.py @@ -9,6 +9,9 @@ def __init__(self, base: dict[str, _Any]) -> None: """ self._d: dict[str, _Any] = base self.srw_mode: bool = True + self.width: int = 720 + self.height: int = 480 + self.fullscreen: bool = False self.refresh_rate: int = 30 self.comm_addr: str = "127.0.0.1" self.comm_port: int = 16900 diff --git a/setup.py b/setup.py index 6ba03a1e..6e54574f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="leads", - version="0.1.3", + version="0.1.4", author="ProjectNeura", author_email="central@projectneura.org", description="Lightweight Embedded Assisted Driving System",