Working serial command sender

This commit is contained in:
2026-05-16 13:31:02 +02:00
parent d56c7605a1
commit e5fd5cda89
6 changed files with 54 additions and 7 deletions

View File

@@ -4,9 +4,19 @@
import dearpygui.dearpygui as dpg
from dataflux.tags import TEXT_SERIAL_CONSOLE
from dataflux.tags import CHILD_WINDOW_SERIAL_CONSOLE, TEXT_SERIAL_CONSOLE
def append_text_to_console(text: str) -> None:
old = dpg.get_value(TEXT_SERIAL_CONSOLE)
dpg.set_value(TEXT_SERIAL_CONSOLE, old + text)
def scroll_to_bottom() -> None:
dpg.set_y_scroll(
CHILD_WINDOW_SERIAL_CONSOLE,
dpg.get_y_scroll_max(CHILD_WINDOW_SERIAL_CONSOLE),
)
frame = dpg.get_frame_count()
dpg.set_frame_callback(frame + 1, scroll_to_bottom)
dpg.set_frame_callback(frame + 2, scroll_to_bottom)