Disconnection detection added
PC checks for connection Esp32 send Heartbeat
This commit is contained in:
@@ -128,6 +128,19 @@ def create_parameter_gui(on_start_callback=None, on_stop_callback=None):
|
||||
dpg.show_viewport()
|
||||
|
||||
|
||||
def update_robot_status(status: str):
|
||||
"""Update the robot connection label from the GUI event loop."""
|
||||
labels = {
|
||||
"connecting": ("Status: CONNECTING TO ROBOT", (255, 200, 0)),
|
||||
"connected": ("Status: RUNNING", (0, 255, 0)),
|
||||
"reconnecting": ("Robot Disconnected - Reconnecting...", (255, 150, 0)),
|
||||
"disconnected": ("Robot Disconnected", (255, 100, 100)),
|
||||
}
|
||||
label, color = labels.get(status, ("Status: RUNNING", (0, 255, 0)))
|
||||
if dpg.is_dearpygui_running():
|
||||
dpg.configure_item("status_text", default_value=label, color=color)
|
||||
|
||||
|
||||
def resolve_active_command(gamepad_cmd: dict | None) -> dict:
|
||||
"""Selects motion vector based on current active source in GUI."""
|
||||
source = input_config["source"]
|
||||
|
||||
Reference in New Issue
Block a user