syntax = "proto3";

package autd3;

import "gain.proto";
import "utils.proto";
import "utils-lightweight.proto";

message Clear {}

message SilencerFixedUpdateRate {
      uint32 value_intensity = 1;
      uint32 value_phase = 2;
}

message SilencerFixedCompletionSteps {
      uint32 value_intensity = 1;
      uint32 value_phase = 2;
      bool strict_mode = 3;
}

message Silencer {
    oneof config {
        SilencerFixedUpdateRate fixed_update_rate = 1;
        SilencerFixedCompletionSteps fixed_completion_steps = 2;
    }
}

message Synchronize {}

message ForceFan {
    repeated bool value = 1;
}

message ReadsFPGAState {
    repeated bool value = 1;
}

message GainSTM {
    SamplingConfig config = 1;
    LoopBehavior loop_behavior = 2;
    Segment segment = 3;
    repeated Gain gains = 5;
    optional TransitionMode transition_mode = 6;
    optional uint64 transition_value = 7;
}

message FociSTMProps {
    SamplingConfig config = 1;
    LoopBehavior loop_behavior = 2;
    Segment segment = 3;
    optional TransitionMode transition_mode = 4;
    optional uint64 transition_value = 5;
}

message FociSTM1 {
    FociSTMProps props = 1;
    repeated ControlPoints foci = 2;
}

message FociSTM2 {
    FociSTMProps props = 1;
    repeated ControlPoints foci = 2;
}

message FociSTM3 {
    FociSTMProps props = 1;
    repeated ControlPoints foci = 2;
}

message FociSTM4 {
    FociSTMProps props = 1;
    repeated ControlPoints foci = 2;
}

message FociSTM5 {
    FociSTMProps props = 1;
    repeated ControlPoints foci = 2;
}

message FociSTM6 {
    FociSTMProps props = 1;
    repeated ControlPoints foci = 2;
}

message FociSTM7 {
    FociSTMProps props = 1;
    repeated ControlPoints foci = 2;
}

message FociSTM8 {
    FociSTMProps props = 1;
    repeated ControlPoints foci = 2;
}

message FociSTM {
  oneof inner {
    FociSTM1 n1 = 1;
    FociSTM2 n2 = 2;
    FociSTM3 n3 = 3;
    FociSTM4 n4 = 4;
    FociSTM5 n5 = 5;
    FociSTM6 n6 = 6;
    FociSTM7 n7 = 7;
    FociSTM8 n8 = 8;
  }
}

message SwapSegmentGain {
    Segment segment = 1;
}

message SwapSegmentModulation {
    Segment segment = 1;
    TransitionMode transition_mode = 2;
    uint64 transition_value = 3;
}

message SwapSegmentFociSTM {
    Segment segment = 1;
    TransitionMode transition_mode = 2;
    uint64 transition_value = 3;
}

message SwapSegmentGainSTM {
    Segment segment = 1;
    TransitionMode transition_mode = 2;
    uint64 transition_value = 3;
}

message SwapSegment {
  oneof inner {
    SwapSegmentGain gain = 1;
    SwapSegmentModulation modulation = 2;
    SwapSegmentFociSTM foci_stm = 3;
    SwapSegmentGainSTM gain_stm = 4;
  }
}