# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: blickfeld/beam_deflection_control/data/health.proto
# plugin: python-betterproto
from dataclasses import dataclass

import blickfeld_qb2.betterproto as betterproto
import blickfeld_qb2.betterproto.lib.google.protobuf as betterproto_lib_google_protobuf

from ...base import data as __base_data__


@dataclass(eq=False, repr=False)
class Health(betterproto.Message):
    """
    Health message containing information about operation, status and error of
    a beam deflection controller.
    """

    state: "__base_data__.HealthState" = betterproto.enum_field(1)
    """High-level state of module"""

    state_reason: str = betterproto.string_field(2)
    """Reason for given state. Is not set if state is OK."""


@dataclass(eq=False, repr=False)
class HealthStats(betterproto.Message):
    """
    This message defines the stats that can be retrieved from a beam deflection
    controller.
    """

    time: float = betterproto.float_field(1)
    """Current time in s."""

    bb_frequency: float = betterproto.float_field(2)
    """Current BB frequency estimation (only set when running BB)."""

    max_mechanical_scan_range: float = betterproto.float_field(3)
    """
    Maximum MSR which occured. Observer q1 in case of CL, sensor atan in case
    of BB.
    """

    min_dac_u0: int = betterproto.uint32_field(4)
    """Minimum DAC value wich occured for piezo 0."""

    max_dac_u0: int = betterproto.uint32_field(5)
    """Maximum DAC value wich occured for piezo 0."""

    min_dac_u1: int = betterproto.uint32_field(6)
    """Minimum DAC value wich occured for piezo 1."""

    max_dac_u1: int = betterproto.uint32_field(7)
    """Maximum DAC value wich occured for piezo 1."""

    max_cycles: int = betterproto.uint32_field(8)
    """Maximum amount of cycles needed for control loop."""
