diff --git a/proto/src/model.proto b/proto/src/model.proto new file mode 100644 index 0000000..a8caee5 --- /dev/null +++ b/proto/src/model.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; + +package model; + +option go_package = "./model/proto"; + +message Repository { + repeated Turnout turnouts = 1; + repeated Signal Signals = 2; + repeated Section sections = 3; + repeated AxleCounter axleCounters = 4; + repeated Responder responders = 5; + repeated Slope slopes = 6; + repeated Curve curves = 7; +} + +message Turnout { + Id id = 1; + Kilometer kilometer = 2; + Id axleCounterA = 3; //A端关联的计轴 + Id axleCounterB = 4; + Id axleCounterC = 5; +} + +message Signal { + Id id = 1; + Kilometer kilometer = 2; + DevicePort relDevice = 3; //关联的设备,区段或道岔 +} + +message Section { + Id id = 1; + Id axleCounterA = 2; //A端关联的计轴 + Id axleCounterB = 3; //B端关联的计轴 + Id turnout = 4; //岔区区段关联的道岔 +} + +message AxleCounter{ + Id id = 1; + Kilometer kilometer = 2; + bool virtual = 3; //是否虚拟 +} + +message Responder { + Id id = 1; + Kilometer kilometer = 2; +} + +//坡 +message Slope { + Id id = 1; + repeated Point points = 2; + int32 degree = 3; //坡度角的sin * 1000 +} + +//曲线 +message Curve { + Id id = 1; + repeated Point points = 2; + int32 radius = 3; //半径 mm +} + +message DevicePort { + Id deviceId = 1; + Port port = 2; +} + +message Id { + string lineId = 1; + string stationId = 2; + string index = 3; +} + +enum Port { + UNKNOWN = 0; + A = 1; + B = 2; + C = 3; +} + +//公里标 +message Kilometer { + int64 kilometer = 1; //公里标mm + string coordinateSystem = 2; //坐标系 + Direction direction = 3; //左右行 +} + +//左右行 +enum Direction { + LEFT = 0; + RIGHT = 1; +} + +//图中一点 +message Point { + repeated Kilometer kilometers = 1; +} \ No newline at end of file