Skip to content

UI Kit & Widgets

color_picker_widget.py

File: ui\widgets\color_picker_widget.py

class ColorPickerWidget(ctk.CTkFrame) (line 13)

Constructor: ColorPickerWidget(master, current_color, command)

Public Methods: * set_color(hex_color) — No docstring * get() — No docstring

correlation_graph_widget.py

File: ui\widgets\correlation_graph_widget.py

class CorrelationGraphWidget(ctk.CTkFrame) (line 28)

Real-time correlation graph plotting UV LED mA (X) vs UV Sensor mV (Y).

Features: - Scatter plot with connected line - Linear regression fit overlay - R² coefficient display - Sensitivity (slope) calculation: mV/mA - Rolling window data support - Material 3 Expressive theming

Constructor: CorrelationGraphWidget(master, window_points: int)

Public Methods: * add_point(led_ma: float, sensor_mv: float, error_val: float) — Add a new data point to the correlation plot. * update_plot() — Update the correlation plot with current data. * start_animation(interval_ms: int) — Start live animation (updates every interval_ms). * stop_animation() — Stop live animation and force final update. * clear() — Clear all data and reset graph. * get_data() — Export current data as dictionary. * get_sensitivity() — Get the current sensitivity analysis results. * destroy() — Cleanup on destroy.

graph_widget.py

File: ui\widgets\graph_widget.py

class LiveGraphWidget(ctk.CTkFrame) (line 17)

Enhanced real-time graph with multiple traces and scrolling window.

Features: - 3 subplots: Current (mA), Temperature (°C), Sensor (mV) - Rolling window (configurable, default 5 minutes) - Live statistics display - Smooth animation at 1Hz

Constructor: LiveGraphWidget(master, window_seconds: int)

Public Methods: * add_sample(time_s: float, current_ma: float, temp_c: float, sensor_mv: float) — Add a new data sample to all traces. * update_plot() — Update all plot lines with current data. * start_animation(interval_ms: int) — Start live animation (updates every interval_ms). * stop_animation() — Stop live animation. * clear() — Clear all data and reset graph. * get_data() — Export current data as dictionary.

class RealTimeGraph(ctk.CTkFrame) (line 261)

Legacy single-trace graph for backward compatibility.

Constructor: RealTimeGraph(master, title, xlabel, ylabel)

Public Methods: * update_graph(x, y) — No docstring * clear() — No docstring * set_labels(xlabel, ylabel) — No docstring

material_widgets.py

File: ui\widgets\material_widgets.py

class MaterialButton(ctk.CTkButton) (line 6)

Constructor: MaterialButton(master, style, accessible_name: str)

class MaterialCard(ctk.CTkFrame) (line 88)

Constructor: MaterialCard(master, elevation)

class MaterialLabel(ctk.CTkLabel) (line 105)

Constructor: MaterialLabel(master, style)

class NavigationButton(ctk.CTkFrame) (line 132)

Navigation button with icon (Material Icons) and text label.

Constructor: NavigationButton(master, isActive, command, accessible_name: str)

Public Methods: * set_collapsed(collapsed: bool) — Toggle between icon-only and full display. * configure() — Override configure to handle text_color for child labels.

test_result_card.py

File: ui\widgets\test_result_card.py

class TestResultCard(ctk.CTkFrame) (line 71)

Card widget displaying a single test result with pending/pass/fail states.

Constructor: TestResultCard(master, name: str, passed: bool, details: str)

Create a test result card.

Args: name: Test name passed: True=pass, False=fail, None=pending (grey) details: Additional details

Public Methods: * update_result(passed: bool, details: str) — Update the card with test result (transition from pending to pass/fail).

class CategoryHeader(ctk.CTkFrame) (line 189)

Header for a test category - Material 3 Expressive style.

Constructor: CategoryHeader(master, category_name: str)

class ResponsiveCardGrid(ctk.CTkScrollableFrame) (line 233)

Responsive grid that adjusts columns based on width.

Constructor: ResponsiveCardGrid(master)

Public Methods: * clear() — Remove all cards. * add_result(name: str, passed: bool, details: str, category: str) — Add a test result card. * render() — Render all cards - call after adding all results.

time_graph_widget.py

File: ui\widgets\time_graph_widget.py

class TimeGraphWidget(ctk.CTkFrame) (line 27)

Real-time time-series graph plotting UV Sensor (mV) over time (or sample index).

Constructor: TimeGraphWidget(master, window_points: int)

Public Methods: * reset_time() — No docstring * add_point(sensor_mv: float) — No docstring * update_plot() — No docstring * clear() — No docstring * start_animation(interval_ms: int) — No docstring * stop_animation() — No docstring * destroy() — No docstring