# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: blickfeld/detector/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 giving information about operation status and possible
    errors.
    """

    state: "__base_data__.HealthState" = betterproto.enum_field(1)
    """High-level state of the 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 HealthApd(betterproto.Message):
    """Current status of APD operation."""

    bias_voltage: float = betterproto.float_field(1)
    """Current APD bias voltage."""

    temperature_compensation: bool = betterproto.bool_field(2)
    """
    Flag indicating whether temperature compensation is used. If not, static
    voltage is used.
    """

    multiplication_factor: int = betterproto.uint32_field(3)
    """
    Currently used multiplication factor. Only valid if temperature
    compensation is used.
    """

    temperature: float = betterproto.float_field(4)
    """
    Current temperature measured with dedicated temperature IC which is
    thermally coupled to the APD.
    """
