From 1672a8c0e2b41c4076c1dc9ec852f425dcba21c3 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 19 Sep 2024 10:42:08 +0800 Subject: [PATCH] =?UTF-8?q?protoc=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cctv_graphic_data.proto | 25 -------- src/common.proto | 16 ++--- src/fas_graphic_data.proto | 41 ------------- src/iscs_graphic_data.proto | 116 ++++++++++++++++++------------------ 4 files changed, 65 insertions(+), 133 deletions(-) delete mode 100644 src/cctv_graphic_data.proto delete mode 100644 src/fas_graphic_data.proto diff --git a/src/cctv_graphic_data.proto b/src/cctv_graphic_data.proto deleted file mode 100644 index 293e63d..0000000 --- a/src/cctv_graphic_data.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -import "iscs_graphic_data.proto"; - -package CCTVGraphicData; - -message CCTVGraphicStorage { - iscsGraphicData.Canvas canvas = 1; - repeated CCTVButton cctvButtons = 2; - repeated iscsGraphicData.Arrow arrows = 3; - repeated iscsGraphicData.IscsText iscsTexts = 4; - repeated iscsGraphicData.Rect rects = 5; -} - - -/** CCTV按钮 */ -message CCTVButton { - enum ButtonType { - rect = 0; - monitor = 1; //监控样子的按钮 - semicircle = 2; //半圆样子的按钮 - } - iscsGraphicData.CommonInfo common = 1; - string code = 2; - ButtonType buttonType = 3; -} diff --git a/src/common.proto b/src/common.proto index fda9a35..e4de542 100644 --- a/src/common.proto +++ b/src/common.proto @@ -9,17 +9,17 @@ message Canvas { // 画布高 int32 height = 2; // 背景色 - string background_color = 3; + string backgroundColor = 3; // 视口变换 - Transform viewport_transform = 4; + Transform viewportTransform = 4; //画布格子背景 - Grid grid_background = 5; + Grid gridBackground = 5; } //格子背景 message Grid { - bool has_grid = 1; - string line_color = 2; // 线色 + bool hasGrid = 1; + string lineColor = 2; // 线色 int32 space = 3; //间隔 } @@ -55,11 +55,11 @@ message CommonInfo { // 数据id uint32 id = 1; // 数据类型 - string graphic_type = 2; + string graphicType = 2; // 变换 Transform transform = 3; // 子元素变换 - repeated ChildTransform children_transform = 4; + repeated ChildTransform childTransforms = 4; } // 数据类型 @@ -91,4 +91,4 @@ enum FeatureType { FeatureType_Simulation = 1; // 运行图编制 FeatureType_RunPlan = 2; -} \ No newline at end of file +} diff --git a/src/fas_graphic_data.proto b/src/fas_graphic_data.proto deleted file mode 100644 index 49fda19..0000000 --- a/src/fas_graphic_data.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; -import "iscs_graphic_data.proto"; - -package FASGraphicData; - -message FASGraphicStorage { - iscsGraphicData.Canvas canvas = 1; - repeated iscsGraphicData.Arrow arrows = 2; - repeated iscsGraphicData.IscsText iscsTexts = 3; - repeated iscsGraphicData.Rect rects = 4; - repeated ManualAlarmButton manualAlarmButtons = 5; - repeated HydrantAlarmButton hydrantAlarmButtons = 6; - repeated GasExtinguishing gasExtinguishings = 7; -} - - -message ManualAlarmButton { //手动报警按钮 - iscsGraphicData.CommonInfo common = 1; - string code = 2; -} - -message HydrantAlarmButton { //消防栓报警按钮 - iscsGraphicData.CommonInfo common = 1; - string code = 2; -} - -message GasExtinguishing { //气体灭火 - iscsGraphicData.CommonInfo common = 1; - string code = 2; -} - -message SmokeDetector { //烟雾探测器 - iscsGraphicData.CommonInfo common = 1; - string code = 2; -} - -message TemperatureDetector { //温度探测器 - iscsGraphicData.CommonInfo common = 1; - string code = 2; - -} diff --git a/src/iscs_graphic_data.proto b/src/iscs_graphic_data.proto index e2df557..943b938 100644 --- a/src/iscs_graphic_data.proto +++ b/src/iscs_graphic_data.proto @@ -1,59 +1,14 @@ syntax = "proto3"; + +import "common.proto"; package iscsGraphicData; -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 { -// string oldid = 1; - string graphicType = 2; - Transform transform = 3; - repeated ChildTransform childTransforms = 4; - uint32 id = 5; +message IscsGraphicStorage { + common.Canvas canvas = 1; + repeated Arrow arrows = 2; + repeated IscsText iscsTexts = 3; + repeated Rect rects = 4; + repeated CCTVButton cctvButtons = 5; } message UniqueIdOfStationLayout { @@ -63,14 +18,14 @@ message UniqueIdOfStationLayout { } message Arrow { - CommonInfo common = 1; + common.CommonInfo common = 1; string code = 2; - repeated Point points = 3; + repeated common.Point points = 3; } -/** Iscs文字 */ +//Iscs文字 message IscsText { - CommonInfo common = 1; + common.CommonInfo common = 1; string code = 2; string content = 3; string color = 4; @@ -78,12 +33,55 @@ message IscsText { } message Rect { - CommonInfo common = 1; + common.CommonInfo common = 1; string code = 2; int32 lineWidth = 3; // 线宽 string lineColor = 4; // 线色 float width = 5; //宽度 float height = 6; //高度 int32 radius = 7; //圆角半径 - Point point = 8; // 画第一个点的坐标 + common.Point point = 8; // 画第一个点的坐标 +} + +//CCTV按钮 +message CCTVButton { + enum ButtonType { + rect = 0; + monitor = 1; //监控样子的按钮 + semicircle = 2; //半圆样子的按钮 + } + common.CommonInfo common = 1; + string code = 2; + ButtonType buttonType = 3; +} + +//手动报警按钮 +message ManualAlarmButton { + common.CommonInfo common = 1; + string code = 2; +} + +//消防栓报警按钮 +message HydrantAlarmButton { + common.CommonInfo common = 1; + string code = 2; +} + +//气体灭火 +message GasExtinguishing { + common.CommonInfo common = 1; + string code = 2; +} + +//烟雾探测器 +message SmokeDetector { + common.CommonInfo common = 1; + string code = 2; +} + +//温度探测器 +message TemperatureDetector { + common.CommonInfo common = 1; + string code = 2; + }