

# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: blickfeld/system/data/firmware.proto, blickfeld/system/data/health.proto, blickfeld/system/data/network_status.proto, blickfeld/system/data/scan_pattern.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 (
    config as __base_config__,
    data as __base_data__,
)
from .. import config as _config__


@dataclass(eq=False, repr=False)
class Firmware(betterproto.Message):
    """
    The Firmware data message contains all relevant information about the
    current firmware, uploaded firmware and the status of an firmware
    installation.
    """

    pass


@dataclass(eq=False, repr=False)
class FirmwareInfo(betterproto.Message):
    """
    contains information about rauc bundle parsed from the associated manifest
    file
    """

    label: str = betterproto.string_field(1)
    """Human-readable label / version of the firmware"""

    version: "__base_data__.Version" = betterproto.message_field(2)
    """Version"""

    allowed_downgrade_version: "__base_data__.Version" = betterproto.message_field(3)
    """
    Lowest allowed version which can be downgraded to if this firmware is
    installed
    """


@dataclass(eq=False, repr=False)
class FirmwareStatus(betterproto.Message):
    """contains information about rauc bridge status"""

    idle: "FirmwareStatusIdle" = betterproto.message_field(1, group="status")
    """no bundle is available and no installation is happenning"""

    ready_to_install: "FirmwareStatusReadyToInstall" = betterproto.message_field(
        2, group="status"
    )
    """bundle is verified and available for installation"""

    installation: "FirmwareStatusInstallation" = betterproto.message_field(
        3, group="status"
    )
    """the installation process is ongoing"""

    failure: "FirmwareStatusFailure" = betterproto.message_field(4, group="status")
    """installation failed"""

    reboot: "FirmwareStatusReboot" = betterproto.message_field(5, group="status")
    """reboot has been triggered after successfull installation"""

    installed_firmware_info: "FirmwareInfo" = betterproto.message_field(6)
    """Currently installed firmware"""


@dataclass(eq=False, repr=False)
class FirmwareStatusIdle(betterproto.Message):
    """
    initial state when no bundle is available and no installation is happenning
    """

    pass


@dataclass(eq=False, repr=False)
class FirmwareStatusReadyToInstall(betterproto.Message):
    """state when bundle is verified and available for installation"""

    uploaded_firmware_info: "FirmwareInfo" = betterproto.message_field(1)
    """Firmware info of bundle which has been uploaded"""


@dataclass(eq=False, repr=False)
class FirmwareStatusInstallation(betterproto.Message):
    """state when the installation process is ongoing"""

    progress: "FirmwareStatusInstallationProgress" = betterproto.message_field(1)
    """Current installation progress"""


@dataclass(eq=False, repr=False)
class FirmwareStatusInstallationProgress(betterproto.Message):
    """
    Contains information about current state of installation procedure inside
    the tree of progress
    """

    percent: int = betterproto.uint32_field(1)
    """progress of installation in percents (0%-100%)"""

    message: str = betterproto.string_field(2)
    """log message describing the current installation step"""


@dataclass(eq=False, repr=False)
class FirmwareStatusFailure(betterproto.Message):
    """state when installation failed"""

    reason: str = betterproto.string_field(1)
    """Human-readable reason for installation failure"""


@dataclass(eq=False, repr=False)
class FirmwareStatusReboot(betterproto.Message):
    """
    state when reboot of the device has been triggered after successfull
    installation
    """

    pass


@dataclass(eq=False, repr=False)
class NetworkStatus(betterproto.Message):
    """
    Carries information about active connection: current statistics and network
    configuration
    """

    state: "__base_data__.HealthState" = betterproto.enum_field(3)
    """High-level state of the time synchronization"""

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

    active_config: "_config__.Network" = betterproto.message_field(1)
    """Brings configuration information about currently active connection"""

    link_speed: int = betterproto.uint32_field(5)
    """Link speed of network interface"""


@dataclass(eq=False, repr=False)
class Health(betterproto.Message):
    """Message representing health"""

    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 STATE_OK."""

    time_synchronization: "HealthTimeSynchronization" = betterproto.message_field(3)
    """Time synchronization status"""

    network: "NetworkStatus" = betterproto.message_field(4)
    """Network status"""


@dataclass(eq=False, repr=False)
class HealthTimeSynchronization(betterproto.Message):
    """Status message for time synchronization"""

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

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

    current_system_timestamp: int = betterproto.uint64_field(3)
    """Current timestamp"""

    current_time_zone: str = betterproto.string_field(5)
    """Current time zone"""

    ntp: "HealthTimeSynchronizationNtp" = betterproto.message_field(4, group="type")
    """Status for NTP time synchronization"""


@dataclass(eq=False, repr=False)
class HealthTimeSynchronizationNtp(betterproto.Message):
    """Status message representing the NTP time synchronization status"""

    synchronized: bool = betterproto.bool_field(1)
    """Flag indicating that the system time is synchronized with NTP"""

    server: str = betterproto.string_field(2)
    """The server NTP time server which is used"""

    offset: float = betterproto.float_field(3)
    """Time offset between Qb2 system time and time server"""

    delay: float = betterproto.float_field(4)
    """Time delay from NTP request until server response is received"""

    jitter: float = betterproto.float_field(5)
    """Jitter between multiple time comparisons"""

    precision: float = betterproto.float_field(6)
    """Precision of the NTP time synchronization"""


@dataclass(eq=False, repr=False)
class ScanPatternLimits(betterproto.Message):
    """
    This section contains limits for configurable parameters of a scan pattern
    """

    horizontal: "ScanPatternLimitsHorizontal" = betterproto.message_field(1)
    vertical: "ScanPatternLimitsVertical" = betterproto.message_field(2)
    frame_rate: "ScanPatternLimitsFrameRate" = betterproto.message_field(3)


@dataclass(eq=False, repr=False)
class ScanPatternLimitsHorizontal(betterproto.Message):
    """
    This section defines the value limits for the horizontal configuration
    """

    field_of_view: "__base_config__.RangeFloat" = betterproto.message_field(1)
    """The field of view limits"""


@dataclass(eq=False, repr=False)
class ScanPatternLimitsVertical(betterproto.Message):
    """This section defines the value limits for the vertical configuration"""

    field_of_view: "__base_config__.RangeFloat" = betterproto.message_field(1)
    """The field of view limits"""

    scanlines_up: "__base_config__.RangeUint32" = betterproto.message_field(2)
    """The up-ramping scanline limits"""

    scanlines_down: "__base_config__.RangeUint32" = betterproto.message_field(3)
    """The down-ramping scanline limits"""

    foveation: "ScanPatternLimitsVerticalFoveation" = betterproto.message_field(4)


@dataclass(eq=False, repr=False)
class ScanPatternLimitsVerticalFoveation(betterproto.Message):
    """This section defines the limits for the foveation configuration"""

    fraction: "__base_config__.RangeFloat" = betterproto.message_field(1)
    """The foveation fraction limit"""

    density_factor: "__base_config__.RangeFloat" = betterproto.message_field(2)
    """The density factor limits"""

    scanlines: "__base_config__.RangeUint32" = betterproto.message_field(3)
    """The foveated scanlines limits"""


@dataclass(eq=False, repr=False)
class ScanPatternLimitsFrameRate(betterproto.Message):
    """
    This section defines the value limits for the frame rate configuration
    """

    target: "__base_config__.RangeDouble" = betterproto.message_field(1)
    """The target frame rate limit"""
