syntax = "proto3";

package ansys.api.edb.v1;

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

// PAD_TYPE type enum
enum PadType {
  REGULAR_PAD = 0;
  ANTI_PAD = 1;
  THERMAL_PAD = 2;
  HOLE = 3;
  UNKNOWN_GEOM_TYPE = 4;
}

// PAD_GEOMETRY_TYPE type enum
enum PadGeometryType {
  PADGEOMTYPE_NO_GEOMETRY = 0;
  PADGEOMTYPE_CIRCLE = 1;
  PADGEOMTYPE_SQUARE = 2;
  PADGEOMTYPE_RECTANGLE = 3;
  PADGEOMTYPE_OVAL = 4;
  PADGEOMTYPE_BULLET = 5;
  PADGEOMTYPE_NSIDED_POLYGON = 6;
  PADGEOMTYPE_POLYGON = 7;
  PADGEOMTYPE_ROUND45 = 8;
  PADGEOMTYPE_ROUND90 = 9;
  PADGEOMTYPE_SQUARE45 = 10;
  PADGEOMTYPE_SQUARE90 = 11;
  PADGEOMTYPE_INVALID_GEOMETRY = 12;
}

// PADSTACK_HOLE_RANGE type enum
enum PadstackHoleRange {
  THROUGH = 0;
  BEGIN_ON_UPPER_PAD = 1;
  END_ON_LOWER_PAD = 2;
  UPPER_PAD_TO_LOWER_PAD = 3;
  UNKNOWN_RANGE = 4;
}

// SOLDERBALL_SHAPE type enum
enum SolderballShape {
  NO_SOLDERBALL = 0;
  SOLDERBALL_CYLINDER = 1;
  SOLDERBALL_SPHEROID = 2;
  UNKNOWN_SOLDERBALL_SHAPE = 3;
}

// SOLDERBALL_PLACEMENT type enum
enum SolderballPlacement {
  ABOVE_PADSTACK = 0;
  BELOW_PADSTACK = 1;
  UNKNOWN_PLACEMENT = 2;
}

// CONNECTIONPT_DIRECTION type enum
enum ConnectionPtDirection {
  PS_NO_DIRECTION = 0;
  PS_ANY_DIRECTION = 1;
  PS_0_DIRECTION = 2;
  PS_45_DIRECTION = 3;
  PS_90_DIRECTION = 4;
  PS_135_DIRECTION = 5;
  PS_180_DIRECTION = 6;
  PS_225_DIRECTION = 7;
  PS_270_DIRECTION = 8;
  PS_315_DIRECTION = 9;
  PS_UNKNOWN_DIRECTION = 10;
}

service PadstackDefDataService {
  // create a PadstackDefData
  rpc Create(google.protobuf.Empty) returns (EDBObjMessage) {}
  
  // get material of PadstackDefData
  rpc GetMaterial(EDBObjMessage) returns (google.protobuf.StringValue) {}
  
  // set material of PadstackDefData
  rpc SetMaterial(PadstackDefDataSetMaterialMessage) returns (google.protobuf.Empty) {}

  // get layer names from PadstackDefData
  rpc GetLayerNames(EDBObjMessage) returns (PadstackDefDataGetLayerNamesMessage) {}
  
  // get LayerIds from PadstackDefData
  rpc GetLayerIds(EDBObjMessage) returns (PadstackDefDataGetLayerIdsMessage) {}
  
  // add Layers to PadstackDefData
  rpc AddLayers(PadstackDefDataAddLayersMessage) returns (google.protobuf.Empty) {}
  
  // get PadParameters of PadstackDefData
  rpc GetPadParameters(PadstackDefDataGetPadParametersMessage) returns (PadstackDefDataPadParametersMessage) {}

  // set PadParameters of PadstackDefData
  rpc SetPadParameters(PadstackDefDataPadParametersSetMessage) returns (google.protobuf.Empty) {}

  // get PadstackHoleRange of PadstackDefData
  rpc GetHoleRange(EDBObjMessage) returns (PadstackDefDataPadstackHoleRangeMessage) {}
  
  // set PadstackHoleRange of PadstackDefData
  rpc SetHoleRange(PadstackDefDataSetHoleRangeMessage) returns (google.protobuf.Empty) {}
  
  // get plating percentage of PadstackDefData
  rpc GetPlatingPercentage(EDBObjMessage) returns (ValueMessage) {}
  
  // set plating percentage of PadstackDefData
  rpc SetPlatingPercentage(PadstackDefDataSetPlatingPercentage) returns (google.protobuf.Empty) {}
  
  // get SolderBallShape of PadstackDefData
  rpc GetSolderBallShape(EDBObjMessage) returns (PadstackDefDataSolderballShapeMessage) {}
  
  // set SolderBallShape of PadstackDefData
  rpc SetSolderBallShape(PadstackDefDataSetSolderballShapeMessage) returns (google.protobuf.Empty) {}
  
  // get SolderBallPlacement of PadstackDefData
  rpc GetSolderBallPlacement(EDBObjMessage) returns (PadstackDefDataSolderballPlacementMessage) {}
  
  // set SolderBallPlacement of PadstackDefData
  rpc SetSolderBallPlacement(PadstackDefDataSetSolderballPlacementMessage) returns (google.protobuf.Empty) {}
  
  // get solderBall parameters of PadstackDefData
  rpc GetSolderBallParam(EDBObjMessage) returns (PadstackDefDataGetSolderBallParamMessage) {}
  
  // set solderBall parameters of PadstackDefData
  rpc SetSolderBallParam(PadstackDefDataSetSolderBallParamMessage) returns (google.protobuf.Empty) {}
  
  // get solderBall material of PadstackDefData
  rpc GetSolderBallMaterial(EDBObjMessage) returns (google.protobuf.StringValue) {}
  
  // set solderBall material of PadstackDefData
  rpc SetSolderBallMaterial(PadstackDefDataSetSolderBallMaterialMessage) returns (google.protobuf.Empty) {}

  // get ConnectionPt of PadstackDefData
  rpc GetConnectionPt(PadstackDefDataGetConnectionPtMessage) returns (PadstackDefDataConnectionPtMessage) {}

  // set ConnectionPt of PadstackDefData
  rpc SetConnectionPt(PadstackDefDataSetConnectionPtMessage) returns (google.protobuf.Empty) {} 
}

// Message representing target and material
message PadstackDefDataSetMaterialMessage {
  EDBObjMessage target = 1;
  string name = 2;
}

// Message representing 
message PadstackDefDataGetLayerNamesMessage {
  repeated string names= 1;
}

// Message representing multiple layer ids
message PadstackDefDataGetLayerIdsMessage {
  repeated int32 ids = 1;
}

// Message representing a target and multiple layer names
message PadstackDefDataAddLayersMessage{
  EDBObjMessage target = 1;
  PadstackDefDataGetLayerNamesMessage layer_names = 2;
}

// Message representing target to get pad parameters
message PadstackDefDataGetPadParametersMessage{
  EDBObjMessage target = 1;
  oneof layer {
    string layer_name = 2;
    int32 layer_id = 3;
  }
  PadType pad_type = 4;
}

// Message representing get pad parameters
message PadstackDefDataGetPadParametersParametersMessage{
  PadGeometryType geometry_type = 1;
  repeated ValueMessage sizes = 2;
  ValueMessage offset_x = 3;
  ValueMessage offset_y = 4;
  ValueMessage rotation = 5;
}

message PadstackDefDataSetPadParametersMessage{
  PadstackDefDataGetPadParametersMessage params1 = 1;
  PadstackDefDataGetPadParametersParametersMessage params2 = 2;
}

message PadstackDefDataGetPolygonalPadParametersParametersMessage{
  PolygonDataMessage fp = 1;
  ValueMessage offset_x = 2;
  ValueMessage offset_y = 3;
  ValueMessage rotation = 4;
}

message PadstackDefDataSetPolygonalPadParametersMessage{
  PadstackDefDataGetPadParametersMessage params1 = 1;
  PolygonDataMessage fp = 2;
  ValueMessage offset_x = 3;
  ValueMessage offset_y = 4;
  ValueMessage rotation = 5;
}

message PadstackDefDataPadParametersMessage{
  oneof pad_message {
    PadstackDefDataGetPadParametersParametersMessage generic = 1;
    PadstackDefDataGetPolygonalPadParametersParametersMessage polygon = 2;
  }
}

message PadstackDefDataPadParametersSetMessage{
  oneof pad_message {
    PadstackDefDataSetPadParametersMessage generic = 1;
    PadstackDefDataSetPolygonalPadParametersMessage polygon = 2;
  }
}

message PadstackDefDataPadstackHoleRangeMessage{
  PadstackHoleRange hole_range = 1;
}

message PadstackDefDataSetHoleRangeMessage{
  EDBObjMessage target = 1;
  PadstackHoleRange hole_range = 2;
}

message PadstackDefDataSetPlatingPercentage{
  EDBObjMessage target = 1;
  ValueMessage plating_percentage = 2;
}

message PadstackDefDataSolderballShapeMessage{
  SolderballShape solderball_shape = 1;
}

message PadstackDefDataSetSolderballShapeMessage{
  EDBObjMessage target = 1;
  SolderballShape solderball_shape = 2;
}

message PadstackDefDataSolderballPlacementMessage{
  SolderballPlacement solderball_placement = 1;
}

message PadstackDefDataSetSolderballPlacementMessage{
  EDBObjMessage target = 1;
  SolderballPlacement solderball_placement = 2;
}

message PadstackDefDataGetSolderBallParamMessage{
  ValueMessage d1 = 1;
  ValueMessage d2 = 2;
}

message PadstackDefDataSetSolderBallParamMessage{
  EDBObjMessage target = 1;
  ValueMessage d1 = 2;
  ValueMessage d2 = 3;
}

message PadstackDefDataSetSolderBallMaterialMessage{
  EDBObjMessage target = 1;
  string material = 2;
}

message PadstackDefDataGetConnectionPtMessage {
  EDBObjMessage target = 1;
  string layer = 2;
}

message PadstackDefDataSetConnectionPtMessage {
  EDBObjMessage target = 1;
  string layer = 2;
  ValueMessage x = 3;
  ValueMessage y = 4;
  ConnectionPtDirection direction = 5;
}

message PadstackDefDataConnectionPtMessage {
  ValueMessage x = 1;
  ValueMessage y = 2;
  ConnectionPtDirection direction = 3;
}