添加common.proto,将通用的Message定义在这里面

This commit is contained in:
soul-walker 2024-09-14 16:38:26 +08:00
parent 9dee9892e8
commit 1a527b7708
3 changed files with 117 additions and 88 deletions

View File

@ -1,88 +0,0 @@
syntax = "proto3";
package basic_signal_data;
message Storage {
Canvas canvas = 1;
repeated Station stations = 2;
}
//
message Canvas {
//
int32 width = 1;
//
int32 height = 2;
//
string backgroundColor = 3;
//
Transform viewportTransform = 4;
//
Grid gridBackground = 5;
}
//
message Grid {
bool hasGrid = 1;
string lineColor = 2; // 线
int32 space = 3; //
}
//
message Point {
// x坐标
float x = 1;
// y坐标
float y = 2;
}
//
message Transform {
//
Point position = 1;
//
Point scale = 2;
//
float rotation = 3;
//
Point skew = 4;
}
//
message ChildTransform {
//
string name = 1;
//
Transform transform = 2;
}
//
message CommonInfo {
// id
uint32 id = 1;
//
string graphicType = 2;
//
Transform transform = 3;
//
repeated ChildTransform childrenTransform = 4;
}
//
message KilometerMark {
//
string coordinate = 1;
//
int64 value = 2;
}
//
message Station {
CommonInfo common = 1;
string name = 2; //
string zhanName = 3; //
string namePinyin = 4; //
KilometerMark km = 6; //
bool concentration = 10; //
bool depots = 11; //
repeated uint32 manageStationIds = 13; // -id
}

87
src/common.proto Normal file
View File

@ -0,0 +1,87 @@
syntax = "proto3";
package common;
//
message Canvas {
//
int32 width = 1;
//
int32 height = 2;
//
string background_color = 3;
//
Transform viewport_transform = 4;
//
Grid grid_background = 5;
}
//
message Grid {
bool has_grid = 1;
string line_color = 2; // 线
int32 space = 3; //
}
//
message Point {
// x坐标
float x = 1;
// y坐标
float y = 2;
}
//
message Transform {
//
Point position = 1;
//
Point scale = 2;
//
float rotation = 3;
//
Point skew = 4;
}
//
message ChildTransform {
//
string name = 1;
//
Transform transform = 2;
}
//
message CommonInfo {
// id
uint32 id = 1;
//
string graphic_type = 2;
//
Transform transform = 3;
//
repeated ChildTransform children_transform = 4;
}
//
enum DataType {
//
DataType_Unknown = 0;
//
DataType_Em = 1;
// IBP数据
DataType_Ibp = 2;
// PSL数据
DataType_Psl = 3;
// ISCS数据
DataType_Iscs = 4;
}
//
enum FeatureType {
//
FeatureType_Unknown = 0;
// 仿
FeatureType_Simulation = 1;
//
FeatureType_RunPlan = 2;
}

30
src/em_data.proto Normal file
View File

@ -0,0 +1,30 @@
syntax = "proto3";
package em_data;
import "common.proto";
//
message Em {
common.Canvas canvas = 1;
repeated Station stations = 2;
}
//
message KilometerMark {
//
string coordinate = 1;
//
int64 value = 2;
}
//
message Station {
common.CommonInfo common = 1;
string name = 2; //
string zhanName = 3; //
string namePinyin = 4; //
KilometerMark km = 6; //
bool concentration = 10; //
bool depots = 11; //
repeated uint32 manageStationIds = 13; // -id
}