From fecd8ff508b33715cbe24ca892fc19a2d1ad1ef5 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期一, 06 十一月 2023 16:34:05 +0800 Subject: [PATCH] 加锁解决同时读串口时报的资源不可用和超时报错 --- constvar/const.go | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/constvar/const.go b/constvar/const.go index 3f6fc2b..0e126b8 100644 --- a/constvar/const.go +++ b/constvar/const.go @@ -80,7 +80,7 @@ ParityNull Parity = 3 //鏃犳牎楠� ) -func (p Parity) String() string { +func (p Parity) ToString() string { switch p { case ParityEven: return "E" @@ -105,7 +105,7 @@ ProblemCodeNetwork ProblemCode = "network" //缃戠粶閿欒 ProblemCodeDB ProblemCode = "db" //鏁版嵁搴撹繛鎺ラ敊璇� ProblemCodeSerf ProblemCode = "serf" //鏈姞鍏erf闆嗙兢 - ProblemCodeNsq ProblemCode = "nsq" //鏈繛鎺ユ秷鎭槦鍒� + ProblemCodeCloud ProblemCode = "cloud" //鏈繛鎺ヤ簯绔� ProblemCodeDevice ProblemCode = "device" //鏈粦瀹氳澶� ProblemCodeProcessModel ProblemCode = "process_model" //宸ヨ壓鍙傛暟缂哄け ProblemCodePlcConfig ProblemCode = "plc_config" //plc閰嶇疆缂哄け @@ -113,3 +113,16 @@ ProblemCodePlcProcessModelAddressList ProblemCode = "plc_process_model_address_list" //plc鍦板潃琛ㄧ己澶� ProblemCodePlcConnect ProblemCode = "plc_connect" //plc杩炴帴澶辫触 ) + +type SystemStatusKey string + +const ( + SystemStatusKeyNsq SystemStatusKey = "nsq" +) + +type SystemStatusValue string + +const ( + SystemStatusValueNormal SystemStatusValue = "1" + SystemStatusValueUnNormal SystemStatusValue = "2" +) -- Gitblit v1.8.0