Skip to content

models

Pydantic models for telemetry graph configuration.

Configuration is loaded from YAML files to define the layout and behavior of real-time telemetry visualization.

PlotConfig #

Bases: BaseModel

Configuration for a single plot in the telemetry graph.

Source code in cogip/tools/firmware_telemetry/graph/models.py
13
14
15
16
17
18
19
20
21
22
23
class PlotConfig(BaseModel):
    """Configuration for a single plot in the telemetry graph."""

    title: str
    row: int
    col: int
    keys: list[str]
    y_unit: str = ""
    y_range: tuple[float, float] | None = None
    rowspan: int = 1
    colspan: int = 1

TelemetryGraphConfig #

Bases: BaseModel

Complete configuration for the telemetry graph widget.

Attributes:

Name Type Description
plots list[PlotConfig]

List of plot configurations defining the layout.

max_points Annotated[int, Field(ge=100, le=10000)]

Maximum data points per curve before pruning.

retention_seconds Annotated[float, Field(ge=1.0, le=600.0)]

Time window for data retention.

update_interval_ms Annotated[int, Field(ge=16, le=200)]

Graph update interval in milliseconds.

prune_interval Annotated[int, Field(ge=1)]

Prune old data every N updates.

Source code in cogip/tools/firmware_telemetry/graph/models.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
class TelemetryGraphConfig(BaseModel):
    """
    Complete configuration for the telemetry graph widget.

    Attributes:
        plots: List of plot configurations defining the layout.
        max_points: Maximum data points per curve before pruning.
        retention_seconds: Time window for data retention.
        update_interval_ms: Graph update interval in milliseconds.
        prune_interval: Prune old data every N updates.
    """

    plots: list[PlotConfig]
    max_points: Annotated[int, Field(ge=100, le=10000)] = 2000
    retention_seconds: Annotated[float, Field(ge=1.0, le=600.0)] = 60.0
    update_interval_ms: Annotated[int, Field(ge=16, le=200)] = 33
    prune_interval: Annotated[int, Field(ge=1)] = 30