From 1a527b7708d54287dbe5ffb7057212bda8f03cd2 Mon Sep 17 00:00:00 2001 From: soul-walker <31162815+soul-walker@users.noreply.github.com> Date: Sat, 14 Sep 2024 16:38:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0common.proto=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E9=80=9A=E7=94=A8=E7=9A=84Message=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=9C=A8=E8=BF=99=E9=87=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/basic_signal_data.proto | 88 ------------------------------------- src/common.proto | 87 ++++++++++++++++++++++++++++++++++++ src/em_data.proto | 30 +++++++++++++ 3 files changed, 117 insertions(+), 88 deletions(-) delete mode 100644 src/basic_signal_data.proto create mode 100644 src/common.proto create mode 100644 src/em_data.proto diff --git a/src/basic_signal_data.proto b/src/basic_signal_data.proto deleted file mode 100644 index 0d06d6f..0000000 --- a/src/basic_signal_data.proto +++ /dev/null @@ -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 -} diff --git a/src/common.proto b/src/common.proto new file mode 100644 index 0000000..6e1b90f --- /dev/null +++ b/src/common.proto @@ -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; +} \ No newline at end of file diff --git a/src/em_data.proto b/src/em_data.proto new file mode 100644 index 0000000..35de6ba --- /dev/null +++ b/src/em_data.proto @@ -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 +}