Skip to content

Commit

Permalink
Version 0.1.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
ATATC committed Dec 25, 2023
1 parent 99b51b9 commit 4505f90
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion leads_vec/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__: str = "3cb07775"
__version__: str = "99b51b9f"
25 changes: 16 additions & 9 deletions leads_vec/cli.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions leads_vec/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="leads",
version="0.1.3",
version="0.1.4",
author="ProjectNeura",
author_email="[email protected]",
description="Lightweight Embedded Assisted Driving System",
Expand Down

0 comments on commit 4505f90

Please sign in to comment.