

# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: blickfeld/percept_pipeline/data/coordinate_system.proto, blickfeld/percept_pipeline/data/health.proto, blickfeld/percept_pipeline/data/point_cloud_type.proto, blickfeld/percept_pipeline/data/point_type.proto, blickfeld/percept_pipeline/data/state.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import Dict

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 CoordinateSystem(betterproto.Enum):
    """Specifies the coordinates system the data is expressed in"""

    COORDINATE_SYSTEM_UNSPECIFIED = 0
    """
    Coordinate system not specified. Not accepted neither within a request nor
    as response
    """

    COORDINATE_SYSTEM_LOCAL = 1
    """
    The data is expressed in the coordiante system of the data-source/device
    """

    COORDINATE_SYSTEM_TRANSFORMED = 2
    """The data is expressed in a map coordinate system"""


class PointCloudType(betterproto.Enum):
    """The type of the point cloud"""

    POINT_CLOUD_TYPE_UNSPECIFIED = 0
    """The zero value that is not accepted"""

    POINT_CLOUD_TYPE_FULL = 1
    """
    Full point cloud (combined point cloud of all devices or unfiltered point
    cloud coming from one device)
    """

    POINT_CLOUD_TYPE_FOREGROUND = 2
    """Point cloud containing only foreground/points from moving objects"""

    POINT_CLOUD_TYPE_FULL_OPTIMIZED = 3
    """
    Same as 'POINT_CLOUD_TYPE_FULL' but with reduced point cloud density to
    reduce the size of the point cloud
    """

    POINT_CLOUD_TYPE_FILTERED = 4
    """
    Same as 'POINT_CLOUD_TYPE_FULL' but with all points excluded that are in
    exclusion zones
    """

    POINT_CLOUD_TYPE_FILTERED_FOREGROUND = 5
    """
    Same as 'POINT_CLOUD_TYPE_FOREGROUND' but with all points excluded that are
    in exclusion zones
    """

    POINT_CLOUD_TYPE_BACKGROUND = 6
    """
    Point cloud containing the points representing the background model/point
    cloud
    """

    POINT_CLOUD_TYPE_ANNOTATED = 7
    """
    Point cloud containing a collection of points with annotation per point
    """


class State(betterproto.Enum):
    """The states of pipeline"""

    STATE_UNSPECIFIED = 0
    """State field is not set"""

    STATE_STARTING = 1
    """Pipeline is getting started currently."""

    STATE_STABLE = 2
    """
    Pipeline is stable input and output of the pipeline are achieving the same
    frequency. Only very few frames are allowed to be dropped.
    """

    STATE_UNSTABLE = 3
    """
    Pipeline is unstable if the pipeline cannot process all frames of the data
    source and thus has to drop frames to keep up.
    """

    STATE_BROKEN = 4
    """
    Pipeline is broken if the pipeline does not generate the expected outputs,
    i.e. frames or state list at all. This can happen if the devices in the
    'data source' cannot be reached.
    """

    STATE_RESTARTING = 5
    """
    Pipeline is restarting if there is a larger configuration change, i.e. data
    source changed.
    """

    STATE_IDLE = 6
    """No processing is happening in the pipeline."""


class PointType(betterproto.Enum):
    """The type of the point"""

    POINT_TYPE_UNSPECIFIED = 0
    """The point type is unspecified (default)."""

    POINT_TYPE_FOREGROUND = 1
    """The point is part of the foreground point cloud."""

    POINT_TYPE_BACKGROUND = 2
    """The point is part of the background point cloud."""

    POINT_TYPE_FILTERED = 4
    """
    The point is filtered, e.g. by applying an exclusion zone or the radius
    outlier filter.
    """

    POINT_TYPE_SHADOW = 8
    """The point is part of a shadow."""

    POINT_TYPE_OBJECT = 256
    """The point is part of a detected object point cloud."""

    POINT_TYPE_OBJECT_INTRUDING = 512
    """
    The point is part of a detected object point cloud which is currently
    intruding a object based security zone.
    """

    POINT_TYPE_OBJECT_INTRUDER = 1024
    """
    The point is part of a detected object point cloud which was previously
    intruding a object based security zone.
    """


@dataclass(eq=False, repr=False)
class Health(betterproto.Message):
    """
    A health message that contains information about the pipeline status and
    the module itself.
    """

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

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

    data_source: "HealthDataSource" = betterproto.message_field(4)
    """Data source related health information."""


@dataclass(eq=False, repr=False)
class HealthDataSource(betterproto.Message):
    """Data source related health."""

    device: Dict[str, "HealthDataSourceDevice"] = betterproto.map_field(
        1, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
    )
    """Map of devices. The key is the serial number of the device."""


@dataclass(eq=False, repr=False)
class HealthDataSourceDevice(betterproto.Message):
    """Configured device."""

    error_flags: "HealthDataSourceDeviceErrorFlags" = betterproto.message_field(1)
    """Error flags"""


@dataclass(eq=False, repr=False)
class HealthDataSourceDeviceErrorFlags(betterproto.Message):
    """Error flags"""

    connect_failed: bool = betterproto.bool_field(1)
    """
    The connection to the device has failed. This is most probably caused by
    power supply or network connectivity issues.
    """

    start_failed: bool = betterproto.bool_field(2)
    """
    The start-up of the device failed. This indicates that the device can not
    operate properly. Please review the diagnostics information of the device.
    """

    point_cloud_fetch_failed: bool = betterproto.bool_field(3)
    """
    The point cloud fetch failed. This indicates that the device can not
    operate properly or network bandwidth / stability issues.
    """

    environmental_effects: bool = betterproto.bool_field(4)
    """
    There are some environmental influences, e.g. fog, rain or snow in the
    scene.
    """
