Skip to content

UI Components

function_bar.py

File: ui\components\function_bar.py

class FunctionBar(MaterialCard) (line 13)

Top function bar with port selection, connection button, and vitals badges.

Constructor: FunctionBar(master, on_refresh_ports: Callable, on_toggle_connection: Callable, on_mock_controls: Optional[Callable], on_edit_thresholds: Optional[Callable], on_toggle_sensor: Optional[Callable], on_toggle_fan: Optional[Callable], show_mock_button: bool)

Public Methods: * update_ports(ports: list) — Update port dropdown with available ports. * get_selected_port() — Get currently selected port. * set_connected(connected: bool, port: str) — Update UI state for connection status. * update_vitals(temp: Optional[float], led_v: Optional[float], sens_v: Optional[float], thresholds: Dict[str, Any]) — Update vitals badges with current values and threshold-based colors. * flash_heartbeat() — Flash the heartbeat indicator briefly. * update_sensor_state(on: bool) — No docstring * update_fan_state(on: bool) — No docstring * reset_hardware_states() — No docstring * set_manual_controls_enabled(enabled: bool) — No docstring * update_simulation_button_visibility(is_mock_connected: bool) — Show or hide the Simulation button based on connection type.

sidebar.py

File: ui\components\sidebar.py

class Sidebar(ctk.CTkFrame) (line 27)

Collapsible navigation sidebar.

Constructor: Sidebar(master, on_navigate: Callable[[str], None])

Public Methods: * toggle() — Toggle sidebar collapsed/expanded state. * set_active(view_name: str) — Set the active navigation item. * is_collapsed() — Check if sidebar is collapsed.