# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

import agv_calib_sensor_pb2 as agv__calib__sensor__pb2

GRPC_GENERATED_VERSION = '1.78.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + ' but the generated code in agv_calib_sensor_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class SensorCalibrationServiceStub(object):
    """=========================================================
    核心服务：多传感器自动化外参标定代理服务 
    [部署端 Server]：Windows车端 (充当带轮子的三脚架与文件下载服务器)
    [调用端 Client]：Linux标定服务器 (掌控状态机、拉取大文件、算 Ceres 矩阵)
    =========================================================
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.MoveToObservationPose = channel.unary_unary(
                '/agv.calibration.sensor.SensorCalibrationService/MoveToObservationPose',
                request_serializer=agv__calib__sensor__pb2.PoseRequest.SerializeToString,
                response_deserializer=agv__calib__sensor__pb2.StandardResponse.FromString,
                _registered_method=True)
        self.TriggerSyncCapture = channel.unary_unary(
                '/agv.calibration.sensor.SensorCalibrationService/TriggerSyncCapture',
                request_serializer=agv__calib__sensor__pb2.CaptureRequest.SerializeToString,
                response_deserializer=agv__calib__sensor__pb2.CaptureResponse.FromString,
                _registered_method=True)
        self.DownloadImage = channel.unary_stream(
                '/agv.calibration.sensor.SensorCalibrationService/DownloadImage',
                request_serializer=agv__calib__sensor__pb2.DataFetchRequest.SerializeToString,
                response_deserializer=agv__calib__sensor__pb2.FileChunk.FromString,
                _registered_method=True)
        self.DownloadPointCloud = channel.unary_stream(
                '/agv.calibration.sensor.SensorCalibrationService/DownloadPointCloud',
                request_serializer=agv__calib__sensor__pb2.DataFetchRequest.SerializeToString,
                response_deserializer=agv__calib__sensor__pb2.FileChunk.FromString,
                _registered_method=True)
        self.CommitCalibrationResults = channel.unary_unary(
                '/agv.calibration.sensor.SensorCalibrationService/CommitCalibrationResults',
                request_serializer=agv__calib__sensor__pb2.CalibrationPayload.SerializeToString,
                response_deserializer=agv__calib__sensor__pb2.StandardResponse.FromString,
                _registered_method=True)


class SensorCalibrationServiceServicer(object):
    """=========================================================
    核心服务：多传感器自动化外参标定代理服务 
    [部署端 Server]：Windows车端 (充当带轮子的三脚架与文件下载服务器)
    [调用端 Client]：Linux标定服务器 (掌控状态机、拉取大文件、算 Ceres 矩阵)
    =========================================================
    """

    def MoveToObservationPose(self, request, context):
        """---------------------------------------------------------
        第一步：物理走位 (走)
        ---------------------------------------------------------
        💻 [Linux 发送 -> Windows]：调度车辆开到指定的标定观测点，到达后【绝对刹车静止】
        🚙 [Windows 返回 -> Linux]：物理到位抱死刹车后，返回成功回执
        🚨 业务潜台词：Linux 收到回执后，必须在代码里强制 sleep(0.5s) 等待避震悬挂平息，冻结物理空间！
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def TriggerSyncCapture(self, request, context):
        """---------------------------------------------------------
        第二步：防延迟同步锁存 (停与拍)
        ---------------------------------------------------------
        💻 [Linux 发送 -> Windows]：命令车辆瞬间将底层相机的显存和雷达的点云冻结到后备内存池
        🚙 [Windows 返回 -> Linux]：立刻锁存，并返回高精度硬件时间戳，作为后续拉取大文件的唯一“取件码”
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DownloadImage(self, request, context):
        """---------------------------------------------------------
        第三步：大文件流式下载 (传 —— 破解 Windows 网络延迟的绝杀)
        ---------------------------------------------------------
        💻 [Linux 发送 -> Windows]：凭“取件码”请求下载巨大的图片/点云原文件
        🚙 [Windows 持续流式返回 -> Linux]：将 5MB+ 的无损文件切成小块，像流水一样源源不断传回 Linux
        🚨 业务潜台词：必须使用 stream 关键字！否则 gRPC 会因为单包超过 4MB 瞬间崩溃！
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DownloadPointCloud(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CommitCalibrationResults(self, request, context):
        """---------------------------------------------------------
        第四步：标定闭环定稿 (写)
        ---------------------------------------------------------
        💻 [Linux 发送 -> Windows]：Linux 攒够数据算完复杂的 4x4 外参矩阵后，下发给车端持久化保存
        🚙 [Windows 返回 -> Linux]：车端收到后直接覆写 sensor_config.yaml 或注册表，返回成功
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SensorCalibrationServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'MoveToObservationPose': grpc.unary_unary_rpc_method_handler(
                    servicer.MoveToObservationPose,
                    request_deserializer=agv__calib__sensor__pb2.PoseRequest.FromString,
                    response_serializer=agv__calib__sensor__pb2.StandardResponse.SerializeToString,
            ),
            'TriggerSyncCapture': grpc.unary_unary_rpc_method_handler(
                    servicer.TriggerSyncCapture,
                    request_deserializer=agv__calib__sensor__pb2.CaptureRequest.FromString,
                    response_serializer=agv__calib__sensor__pb2.CaptureResponse.SerializeToString,
            ),
            'DownloadImage': grpc.unary_stream_rpc_method_handler(
                    servicer.DownloadImage,
                    request_deserializer=agv__calib__sensor__pb2.DataFetchRequest.FromString,
                    response_serializer=agv__calib__sensor__pb2.FileChunk.SerializeToString,
            ),
            'DownloadPointCloud': grpc.unary_stream_rpc_method_handler(
                    servicer.DownloadPointCloud,
                    request_deserializer=agv__calib__sensor__pb2.DataFetchRequest.FromString,
                    response_serializer=agv__calib__sensor__pb2.FileChunk.SerializeToString,
            ),
            'CommitCalibrationResults': grpc.unary_unary_rpc_method_handler(
                    servicer.CommitCalibrationResults,
                    request_deserializer=agv__calib__sensor__pb2.CalibrationPayload.FromString,
                    response_serializer=agv__calib__sensor__pb2.StandardResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'agv.calibration.sensor.SensorCalibrationService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('agv.calibration.sensor.SensorCalibrationService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class SensorCalibrationService(object):
    """=========================================================
    核心服务：多传感器自动化外参标定代理服务 
    [部署端 Server]：Windows车端 (充当带轮子的三脚架与文件下载服务器)
    [调用端 Client]：Linux标定服务器 (掌控状态机、拉取大文件、算 Ceres 矩阵)
    =========================================================
    """

    @staticmethod
    def MoveToObservationPose(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/agv.calibration.sensor.SensorCalibrationService/MoveToObservationPose',
            agv__calib__sensor__pb2.PoseRequest.SerializeToString,
            agv__calib__sensor__pb2.StandardResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def TriggerSyncCapture(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/agv.calibration.sensor.SensorCalibrationService/TriggerSyncCapture',
            agv__calib__sensor__pb2.CaptureRequest.SerializeToString,
            agv__calib__sensor__pb2.CaptureResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DownloadImage(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(
            request,
            target,
            '/agv.calibration.sensor.SensorCalibrationService/DownloadImage',
            agv__calib__sensor__pb2.DataFetchRequest.SerializeToString,
            agv__calib__sensor__pb2.FileChunk.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DownloadPointCloud(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(
            request,
            target,
            '/agv.calibration.sensor.SensorCalibrationService/DownloadPointCloud',
            agv__calib__sensor__pb2.DataFetchRequest.SerializeToString,
            agv__calib__sensor__pb2.FileChunk.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CommitCalibrationResults(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/agv.calibration.sensor.SensorCalibrationService/CommitCalibrationResults',
            agv__calib__sensor__pb2.CalibrationPayload.SerializeToString,
            agv__calib__sensor__pb2.StandardResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
