dashboard_widget
Dashboard view — KPI cards, grouped detail cards, simulation strip, and chart grid.
Classes:
-
BRMSDashboard–Card-based dashboard with KPIs, grouped details, and chart grid.
-
FormatType–Format types for KPI values.
-
KPIGroupCard–A card containing a header and a 2-column grid of labelled metric values.
-
PlotWidget–Matplotlib-based time-series plot widget.
-
SimulationStrip–Compact horizontal bar showing simulation date, period, and progress.
BRMSDashboard
BRMSDashboard(parent: QWidget | None = None)
Bases: QWidget
Card-based dashboard with KPIs, grouped details, and chart grid.
FormatType
Bases: Enum
Format types for KPI values.
KPIGroupCard
KPIGroupCard(title: str, parent: QWidget | None = None)
Bases: QFrame
A card containing a header and a 2-column grid of labelled metric values.
Methods:
-
add_metric–Add a metric to the grid. Returns nothing — use set_value(key, val) to update.
-
set_value–Update a metric value by key.
add_metric
add_metric(
key: str, label: str, format_type: FormatType
) -> None
Add a metric to the grid. Returns nothing — use set_value(key, val) to update.
set_value
set_value(key: str, value: float | None) -> None
Update a metric value by key.
PlotWidget
PlotWidget(
title: str,
line_titles: list[str],
line_colors: list[str],
*,
use_ratio_formatter: bool = False,
hidden_by_default: set[str] | None = None,
parent: QWidget | None = None,
)
Bases: QWidget
Matplotlib-based time-series plot widget.
Methods:
-
update_plot–Update line data and redraw the plot.
-
update_plot_style–Update figure and axes colors to match the theme.
update_plot
update_plot(
start_date: date | None,
end_date: date | None,
dates: list[date],
data: dict[str, list[float]],
) -> None
Update line data and redraw the plot.
update_plot_style
update_plot_style() -> None
Update figure and axes colors to match the theme.
SimulationStrip
SimulationStrip(parent: QWidget | None = None)
Bases: QFrame
Compact horizontal bar showing simulation date, period, and progress.
Methods:
-
set_date–Update the current simulation date.
-
set_period–Update the simulation period display.
-
set_progress–Update the progress bar value.
set_date
set_date(date: date) -> None
Update the current simulation date.
set_period
set_period(start: date, end: date) -> None
Update the simulation period display.
set_progress
set_progress(percent: int) -> None
Update the progress bar value.