// ###############################################################
// Copyright(c) Carl Zeiss AG, Germany. All Rights Reserved.
//
// Permission is granted to use and distribute this code,
// as long as this copyright notice remains part of the code.
// ###############################################################

syntax = "proto3";
package zen_api.em.hardware.v1;
import "zen_api/em/hardware/v1/acquisition_settings.proto";
import "zen_api/em/hardware/v1/acquisition_status.proto";
import "zen_api/em/hardware/v1/extended_acquisition_settings.proto";

// The SimpleAcquisitionServiceAcquireExtendedSingleFrameRequest class.
message SimpleAcquisitionServiceAcquireExtendedSingleFrameRequest {
   // The imaging settings used to acquire a frame.
   ExtendedAcquisitionSettings settings = 1;
}
// Response object of the AcquireExtendedSingleFrame method of the ZenApi.EM.Hardware.V1.ISimpleAcquisitionApi.
message SimpleAcquisitionServiceAcquireExtendedSingleFrameResponse {
   // A value indicating whether the task to initialize the stage succeeded or not.
   bool task_success = 1;
   // The width in pixels of the image.
   int32 width = 2;
   // The height in pixels of the image.
   int32 height = 3;
   // The image raw data, 1 frame.
   // Frame data as 16 bit per pixel, #pixels = ZenApi.EM.Hardware.V1.SimpleAcquisitionServiceAcquireExtendedSingleFrameResponse.Width * ZenApi.EM.Hardware.V1.SimpleAcquisitionServiceAcquireExtendedSingleFrameResponse.Height.
   // Total length in byte = #pixels * 2.
   bytes image_data = 4;
   // A string message for display to the customer in failure case. This is only for display purpose and the message may change.
   // Empty string on success.
   string message = 5;
}
// The SimpleAcquisitionServiceAcquireSingleFrameRequest class.
message SimpleAcquisitionServiceAcquireSingleFrameRequest {
   // The imaging settings used to acquire a frame.
   AcquisitionSettings settings = 1;
}
// Response object of the AcquireSingleFrame method of the ZenApi.EM.Hardware.V1.ISimpleAcquisitionApi.
message SimpleAcquisitionServiceAcquireSingleFrameResponse {
   // A value indicating whether the task to initialize the stage succeeded or not.
   bool task_success = 1;
   // The width in pixels of the image.
   int32 width = 2;
   // The height in pixels of the image.
   int32 height = 3;
   // The image raw data, 1 frame.
   // Frame data as 16 bit per pixel, #pixels = ZenApi.EM.Hardware.V1.SimpleAcquisitionServiceAcquireSingleFrameResponse.Width * ZenApi.EM.Hardware.V1.SimpleAcquisitionServiceAcquireSingleFrameResponse.Height.
   // Total length in byte = #pixels * 2.
   bytes image_data = 4;
   // A string message for display to the customer in failure case. This is only for display purpose and the message may change.
   // Empty string on success.
   string message = 5;
}
// The SimpleAcquisitionServiceChangeDwellTimeRequest class.
message SimpleAcquisitionServiceChangeDwellTimeRequest {
   // The new dwell time in seconds. Must be in [25e-9, 107] and only multiples of 25e-9s are supported.
   double dwell_seconds = 1;
}
// Response object representing the current acquisition status.
message SimpleAcquisitionServiceChangeDwellTimeResponse {
   // A value indicating whether the task to initialize the stage succeeded or not.
   bool task_success = 1;
}
// The SimpleAcquisitionServiceGetAcquisitionStatusRequest class.
message SimpleAcquisitionServiceGetAcquisitionStatusRequest {
}
// Response object representing the current acquisition status.
message SimpleAcquisitionServiceGetAcquisitionStatusResponse {
   // A value indicating whether the task to initialize the stage succeeded or not.
   AcquisitionStatus status = 1;
}
// The SimpleAcquisitionServiceGetBrightnessRequest class.
message SimpleAcquisitionServiceGetBrightnessRequest {
}
// Response object representing a detector brightness value.
message SimpleAcquisitionServiceGetBrightnessResponse {
   // The brightness in percentage [0, 100].
   double brightness = 1;
}
// The SimpleAcquisitionServiceGetContrastRequest class.
message SimpleAcquisitionServiceGetContrastRequest {
}
// Response object representing a detector contrast value.
message SimpleAcquisitionServiceGetContrastResponse {
   // The contrast in percentage [0, 100].
   double contrast = 1;
}
// The SimpleAcquisitionServiceRegisterOnAcquisitionStatusChangedRequest class.
message SimpleAcquisitionServiceRegisterOnAcquisitionStatusChangedRequest {
}
// Response object representing the current acquisition status.
message SimpleAcquisitionServiceRegisterOnAcquisitionStatusChangedResponse {
   // A value indicating whether the task to initialize the stage succeeded or not.
   AcquisitionStatus status = 1;
}
// The SimpleAcquisitionServiceSetBrightnessRequest class.
message SimpleAcquisitionServiceSetBrightnessRequest {
   // The brightness value to apply in percentage [0, 1].
   double brightness = 1;
}
// Response object representing a detector brightness value.
message SimpleAcquisitionServiceSetBrightnessResponse {
   // The brightness in percentage [0, 100].
   double brightness = 1;
}
// The SimpleAcquisitionServiceSetContrastRequest class.
message SimpleAcquisitionServiceSetContrastRequest {
   // The contrast value to apply in percentage [0, 1].
   double contrast = 1;
}
// Response object representing a detector contrast value.
message SimpleAcquisitionServiceSetContrastResponse {
   // The contrast in percentage [0, 100].
   double contrast = 1;
}
// The SimpleAcquisitionServiceStartExtendedLiveAcquisitionRequest class.
message SimpleAcquisitionServiceStartExtendedLiveAcquisitionRequest {
   // The imaging settings used to acquire multiple frames.
   ExtendedAcquisitionSettings settings = 1;
}
// Response object of the StartExtendedLiveAcquisition method of the ZenApi.EM.Hardware.V1.ISimpleAcquisitionApi.
message SimpleAcquisitionServiceStartExtendedLiveAcquisitionResponse {
   // A value indicating whether the task to acquire an image succeeded or not.
   bool task_success = 1;
   // A string message for display to the customer in failure case. This is only for display purpose and the message may change.
   // Empty string on success.
   string message = 2;
}
// The SimpleAcquisitionServiceStartLiveAcquisitionRequest class.
message SimpleAcquisitionServiceStartLiveAcquisitionRequest {
   // The imaging settings used to acquire multiple frames.
   AcquisitionSettings settings = 1;
}
// Response object of the StartLiveAcquisition method of the ZenApi.EM.Hardware.V1.ISimpleAcquisitionApi.
message SimpleAcquisitionServiceStartLiveAcquisitionResponse {
   // A value indicating whether the task to acquire an image succeeded or not.
   bool task_success = 1;
   // A string message for display to the customer in failure case. This is only for display purpose and the message may change.
   // Empty string on success.
   string message = 2;
}
// The SimpleAcquisitionServiceStopLiveAcquisitionRequest class.
message SimpleAcquisitionServiceStopLiveAcquisitionRequest {
}
// The SimpleAcquisitionServiceStopLiveAcquisitionResponse class.
message SimpleAcquisitionServiceStopLiveAcquisitionResponse {
}
// The ISimpleAcquisitionService interface.
service SimpleAcquisitionService {
   // Call to start single channel acquisition of a single frame with given settings.
   // The task returned represents the ongoing acquisition.
   // The resulting image is send once the acquisition completed.
   rpc AcquireExtendedSingleFrame (SimpleAcquisitionServiceAcquireExtendedSingleFrameRequest) returns (SimpleAcquisitionServiceAcquireExtendedSingleFrameResponse);
   // Call to start single channel acquisition of a single frame with given settings.
   // The task returned represents the ongoing acquisition.
   // The resulting image is send once the acquisition completed.
   rpc AcquireSingleFrame (SimpleAcquisitionServiceAcquireSingleFrameRequest) returns (SimpleAcquisitionServiceAcquireSingleFrameResponse);
   // Changes the dwell time for any ongoing acquisition task.
   rpc ChangeDwellTime (SimpleAcquisitionServiceChangeDwellTimeRequest) returns (SimpleAcquisitionServiceChangeDwellTimeResponse);
   // Retrieves the current state of the acquisition hardware.
   // Allows to deduce if the hardware is available for a new acquisition, is blocked by some other task,
   // or acquires currently images.
   rpc GetAcquisitionStatus (SimpleAcquisitionServiceGetAcquisitionStatusRequest) returns (SimpleAcquisitionServiceGetAcquisitionStatusResponse)
   {
      option idempotency_level = NO_SIDE_EFFECTS;
   }
   // Retrieves the brightness value applied to a specific detector in percentage.
   rpc GetBrightness (SimpleAcquisitionServiceGetBrightnessRequest) returns (SimpleAcquisitionServiceGetBrightnessResponse)
   {
      option idempotency_level = NO_SIDE_EFFECTS;
   }
   // Retrieves the contrast value applied to a specific detector in percentage.
   rpc GetContrast (SimpleAcquisitionServiceGetContrastRequest) returns (SimpleAcquisitionServiceGetContrastResponse)
   {
      option idempotency_level = NO_SIDE_EFFECTS;
   }
   // Subscribes to acquisition status changed events.
   rpc RegisterOnAcquisitionStatusChanged (SimpleAcquisitionServiceRegisterOnAcquisitionStatusChangedRequest) returns (stream SimpleAcquisitionServiceRegisterOnAcquisitionStatusChangedResponse)
   {
      option idempotency_level = NO_SIDE_EFFECTS;
   }
   // Applies a brightness value to a specified detector.
   // The brightness value is applied immediately and has to be in [0, 1].
   rpc SetBrightness (SimpleAcquisitionServiceSetBrightnessRequest) returns (SimpleAcquisitionServiceSetBrightnessResponse);
   // Applies a contrast value to a specified detector.
   // The contrast value is applied immediately and has to be in [0, 1].
   rpc SetContrast (SimpleAcquisitionServiceSetContrastRequest) returns (SimpleAcquisitionServiceSetContrastResponse);
   // This starts a live single channel acquisition with the given settings.
   rpc StartExtendedLiveAcquisition (SimpleAcquisitionServiceStartExtendedLiveAcquisitionRequest) returns (SimpleAcquisitionServiceStartExtendedLiveAcquisitionResponse);
   // This starts a live single channel acquisition with the given settings.
   rpc StartLiveAcquisition (SimpleAcquisitionServiceStartLiveAcquisitionRequest) returns (SimpleAcquisitionServiceStartLiveAcquisitionResponse);
   // Stops any ongoing live acquisition.
   // Has only an effect if ZenApi.EM.Hardware.V1.ISimpleAcquisitionApi.GetAcquisitionStatus returns ZenApi.EM.Hardware.V1.AcquisitionStatus.LiveRunning.
   rpc StopLiveAcquisition (SimpleAcquisitionServiceStopLiveAcquisitionRequest) returns (SimpleAcquisitionServiceStopLiveAcquisitionResponse);
}
