Skip to content

Commit

Permalink
Routine updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
ATATC committed Dec 24, 2023
1 parent ed296c7 commit f9c12f6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
4 changes: 3 additions & 1 deletion leads_dashboard/prototype.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from time import sleep as _sleep
from typing import Callable as _Callable, Self as _Self, TypeVar as _TypeVar, Generic as _Generic

from PySimpleGUI import Window as _Window, Element as _Element, WINDOW_CLOSED as _WINDOW_CLOSED
from PySimpleGUI import Window as _Window, Element as _Element, WINDOW_CLOSED as _WINDOW_CLOSED, theme as _theme

from leads_dashboard.runtime import RuntimeData

Expand Down Expand Up @@ -31,8 +31,10 @@ def __init__(self,
title: str = "LEADS",
fullscreen: bool = True,
no_title_bar: bool = True) -> None:
_theme("Default1")
self._root: _Window = _Window(title,
size=(None if width < 0 else width, None if height < 0 else height),
text_justification="center",
no_titlebar=no_title_bar,
disable_minimize=True)
self._width: int = width
Expand Down
35 changes: 22 additions & 13 deletions leads_vec/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@ def switch_m1_mode():
def switch_m3_mode():
manager.rd().m3_mode = (manager.rd().m3_mode + 1) % 3

manager["m1"] = Button(font=BODY, key=switch_m1_mode, size=(96, 12))
manager["m2"] = Button(font=H1, size=(32, 4))
manager["m3"] = Button(font=H1, key=switch_m3_mode, size=(32, 4))
manager["dtcs_status"] = Text(text="DTCS READY", text_color="green")
manager["abs_status"] = Text(text="ABS READY", text_color="green")
manager["ebi_status"] = Text(text="EBI READY", text_color="green")
manager["atbs_status"] = Text(text="ATBS READY", text_color="green")
manager["comm_status"] = Text(text="COMM ONLINE", text_color="white")
manager["m1"] = Button(font=BODY, key=switch_m1_mode, size=(round(manager.window().width() / 19.393939), 12))
manager["m2"] = Button(font=H1, size=(round(manager.window().width() / 60), 4))
manager["m3"] = Button(font=H1, key=switch_m3_mode, size=(round(manager.window().width() / 64), 4))
manager["dtcs_status"] = Text(text="DTCS READY", text_color="green", font=BODY,
size=(round(manager.window().width() / 32.323232), None))
manager["abs_status"] = Text(text="ABS READY", text_color="green", font=BODY,
size=(round(manager.window().width() / 32.323232), None))
manager["ebi_status"] = Text(text="EBI READY", text_color="green", font=BODY,
size=(round(manager.window().width() / 32.323232), None))
manager["atbs_status"] = Text(text="ATBS READY", text_color="green", font=BODY,
size=(round(manager.window().width() / 32.323232), None))
manager["comm_status"] = Text(text="COMM ONLINE", text_color="white", font=BODY,
size=(round(manager.window().width() / 32.323232), None))

def switch_dtcs():
context.set_dtcs(not (dtcs_enabled := context.is_dtcs_enabled()))
Expand All @@ -59,12 +64,16 @@ def switch_atbs():

add_hotkey("4", switch_atbs)

manager["dtcs"] = Button(button_text="DTCS ON", key=switch_dtcs)
manager["abs"] = Button(button_text="ABS ON", key=switch_abs)
manager["ebi"] = Button(button_text="EBI ON", key=switch_ebi)
manager["atbs"] = Button(button_text="ATBS ON", key=switch_atbs)
manager["dtcs"] = Button(button_text="DTCS ON", key=switch_dtcs, font=BODY,
size=(round(manager.window().width() / 25.858585), None))
manager["abs"] = Button(button_text="ABS ON", key=switch_abs, font=BODY,
size=(round(manager.window().width() / 25.858585), None))
manager["ebi"] = Button(button_text="EBI ON", key=switch_ebi, font=BODY,
size=(round(manager.window().width() / 25.858585), None))
manager["atbs"] = Button(button_text="ATBS ON", key=switch_atbs, font=BODY,
size=(round(manager.window().width() / 25.858585), None))

uim = initialize(Window(1920, 1080,
uim = initialize(Window(1080, 720,
config.refresh_rate,
CustomRuntimeData(),
fullscreen=False,
Expand Down

0 comments on commit f9c12f6

Please sign in to comment.