

# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: blickfeld/laser/data/health.proto, blickfeld/laser/data/mode.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__


class Mode(betterproto.Enum):
    """Operation mode of the laser module"""

    MODE_UNSPECIFIED = 0
    """Unused"""

    MODE_IDLE = 1
    """Nothing is happening, waiting to start."""

    MODE_RAMP_UP = 2
    """
    There were no triggers for a longer time, hence we have to ramp up. Only
    90% of pulse energy is used during triggering.
    """

    MODE_ACTIVE = 3
    """
    Normal mode with triggering happening frequently and laser is triggered
    with max pulse energy according to mode.
    """

    MODE_ERROR = 4
    """
    Something went wrong, laser module is in error state. Please check the
    details in the health status of laser.
    """


@dataclass(eq=False, repr=False)
class Health(betterproto.Message):
    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."""

    reference_temperature: float = betterproto.float_field(6)
    """Current temperature measured with dedicated temperature IC on PCB"""

    mcu_temperature: float = betterproto.float_field(7)
    """Current core temperature of microcontroller"""

    mode: "Mode" = betterproto.enum_field(8)
    """Current Laser operating mode, it has impact on pulse energy"""

    trigger_frequency: float = betterproto.double_field(9)
    """
    The frequency of the laser trigger with an error of +/-pre-scaler value
    """
