Segmentation stage 1
This commit is contained in:
0
src/dataflux/ui/routines/__init__.py
Normal file
0
src/dataflux/ui/routines/__init__.py
Normal file
16
src/dataflux/ui/routines/menu.py
Normal file
16
src/dataflux/ui/routines/menu.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Copyright (C) 2026 Hector van der Aa <hector@h3cx.dev>
|
||||
# Copyright (C) 2026 Association Exergie <association.exergie@gmail.com>
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import dearpygui.dearpygui as dpg
|
||||
|
||||
from dataflux.state import AppState
|
||||
from dataflux.tags import MENU_FILE_CONNECT, MENU_FILE_DISCONNECT
|
||||
|
||||
def update_menu_file_connection_status(state: AppState) -> None:
|
||||
if state.serial_port is None:
|
||||
dpg.enable_item(MENU_FILE_CONNECT)
|
||||
dpg.disable_item(MENU_FILE_DISCONNECT)
|
||||
else:
|
||||
dpg.disable_item(MENU_FILE_CONNECT)
|
||||
dpg.enable_item(MENU_FILE_DISCONNECT)
|
||||
11
src/dataflux/ui/routines/windows.py
Normal file
11
src/dataflux/ui/routines/windows.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# Copyright (C) 2026 Hector van der Aa <hector@h3cx.dev>
|
||||
# Copyright (C) 2026 Association Exergie <association.exergie@gmail.com>
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
import dearpygui.dearpygui as dpg
|
||||
|
||||
from dataflux.services.serial import list_serial_ports
|
||||
from dataflux.tags import WINDOW_CONNECTION_MENU_COMBO
|
||||
|
||||
def update_window_connection_menu_combo() -> None:
|
||||
ports: list[str] = list_serial_ports()
|
||||
dpg.configure_item(WINDOW_CONNECTION_MENU_COMBO, items=ports)
|
||||
Reference in New Issue
Block a user