// Proto file representing the EDB Circle class

syntax = "proto3";

package ansys.api.edb.v1;

import "ansys/api/edb/v1/edb_messages.proto";

service VoltageRegulatorService {
  rpc Create (VoltageRegulatorMessage) returns (EDBObjMessage) {}
  
  rpc GetName(EDBObjMessage) returns (google.protobuf.StringValue) {}
  rpc SetName(EDBObjNameMessage) returns (google.protobuf.Empty) {}

  rpc IsActive(EDBObjMessage) returns (google.protobuf.BoolValue) {}
  rpc SetIsActive(BoolPropertyMessage) returns (google.protobuf.Empty) {}

  rpc GetVoltage(EDBObjMessage) returns (ValueMessage) {}
  rpc SetVoltage(ValuePropertyMessage) returns (google.protobuf.Empty) {}

  rpc GetLoadRegulationCurrent(EDBObjMessage) returns (ValueMessage) {}
  rpc SetLoadRegulationCurrent(ValuePropertyMessage) returns (google.protobuf.Empty) {}

  rpc GetLoadRegulationPercent(EDBObjMessage) returns (ValueMessage) {}
  rpc SetLoadRegulationPercent(ValuePropertyMessage) returns (google.protobuf.Empty) {}

  rpc GetPosRemoteSensePin(EDBObjMessage) returns (EDBObjMessage) {}
  rpc SetPosRemoteSensePin(EDBObjCollectionMessage) returns (google.protobuf.Empty) {}

  rpc GetNegRemoteSensePin(EDBObjMessage) returns (EDBObjMessage) {}
  rpc SetNegRemoteSensePin(EDBObjCollectionMessage) returns (google.protobuf.Empty) {}
  
  rpc GetNPowerModules(EDBObjMessage) returns (google.protobuf.Int64Value){}
  rpc GetNActivePowerModules(EDBObjMessage) returns (google.protobuf.Int64Value) {}

  rpc GetPowerModule(StringPropertyMessage) returns (PowerModuleMessage) {}
  rpc GetAllPowerModules(EDBObjMessage) returns (PowerModulesMessage) {}

  rpc AddPowerModule(PowerModulePropertyMessage) returns (google.protobuf.Empty) {}
  rpc RemovePowerModule(StringPropertyMessage) returns (google.protobuf.Empty) {}

  rpc AddPowerModules(PowerModulesPropertyMessage) returns (google.protobuf.Empty) {}
  rpc RemovePowerModules(StringsPropertyMessage) returns (google.protobuf.Empty) {}
  rpc RemoveAllPowerModules(EDBObjMessage) returns (google.protobuf.Empty) {}
}

message VoltageRegulatorMessage {
  EDBObjMessage layout = 1;
  string name = 2; 
  bool active = 3;
  ValueMessage voltage = 4;
  ValueMessage lrc = 5;
  ValueMessage lrp = 6;
}

message PowerModuleMessage {
  string comp_group_name = 1;
  string pos_output_terminal = 2;
  string neg_output_terminal = 3;
  ValueMessage relative_strength = 4;
  bool active = 5;
  bool needs_sync = 6;
}

message PowerModulesMessage {
  repeated PowerModuleMessage data = 1;
}

message PowerModulePropertyMessage {
  EDBObjMessage vrm = 1;
  PowerModuleMessage module = 2;
}

message PowerModulesPropertyMessage {
  EDBObjMessage vrm = 1;
  PowerModulesMessage modules = 2;
}

