From cf96f6bc1fb484fde16bd5ed6d49534c96958022 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期一, 25 九月 2023 15:43:12 +0800 Subject: [PATCH] fix --- constvar/const.go | 39 +++++++++++++++++++++++++++++---------- 1 files changed, 29 insertions(+), 10 deletions(-) diff --git a/constvar/const.go b/constvar/const.go index 3856612..8b56942 100644 --- a/constvar/const.go +++ b/constvar/const.go @@ -1,12 +1,14 @@ package constvar const ( - NsqTopicScheduleTask = "aps.%v.scheduleTask" //鎺掔▼浠诲姟涓嬪彂 - NsqTopicGetPlcAddress = "aps.%v.getPlcAddress" - NsqTopicSendPlcAddress = "aps.%v.sendPlcAddress" - NsqTopicProcessParamsRequest = "aps.%v.processParams.request" - NsqTopicProcessParamsResponse = "aps.%v.processParams.response" - NsqTopicApsProcessParams = "aps.%v.aps.processParams" //鏈変簡鏂扮殑宸ヨ壓妯″瀷 + NsqTopicScheduleTask = "aps.%v.scheduleTask" //鎺掔▼浠诲姟涓嬪彂 + NsqTopicGetPlcAddress = "aps.%v.getPlcAddress" + NsqTopicSendPlcAddress = "aps.%v.sendPlcAddress" + NsqTopicProcessParamsRequest = "aps.%v.processParams.request" + NsqTopicProcessParamsResponse = "aps.%v.processParams.response" + NsqTopicApsProcessParams = "aps.%v.aps.processParams" //鏈変簡鏂扮殑宸ヨ壓妯″瀷 + NsqTopicTaskProcedureStatusUpdate = "aps.%v.task.procedure.status" //宸ュ簭鐘舵�佹洿鏂� + NsqTopicSyncTaskProgress = "aps.%v.task.procedure.progress" //宸ュ簭鐢熶骇杩涘害 ) type PlcStartAddressType int @@ -32,15 +34,32 @@ type PlcMethod string const ( - PlcMethodModbusTCP PlcMethod = "modbusTCP" - PlcMethodSerial PlcMethod = "serial" + PlcMethodModbusTCP PlcMethod = "modbusTCP" + PlcMethodSerial PlcMethod = "serial" + PlcMethodModbusTCPChinese PlcMethod = "缃戠粶" + PlcMethodSerialChinese PlcMethod = "涓插彛" ) -func (slf PlcMethod) Valid() bool { - return slf == PlcMethodModbusTCP || slf == PlcMethodSerial +func (slf *PlcMethod) ConvertToEnglish() { + if *slf == PlcMethodModbusTCPChinese { + *slf = PlcMethodModbusTCP + } + if *slf == PlcMethodSerialChinese { + *slf = PlcMethodSerial + } +} + +func (slf *PlcMethod) Valid() bool { + return *slf == PlcMethodModbusTCP || *slf == PlcMethodSerial } const ( PlcCacheKeyFinishNumber = "finish_number" PlcCacheKeyTotalNumber = "total_number" ) + +const ( + PlcPackageApache = "apache" + PlcPackageGoBurrow = "goBurrow" + PlcPackageApacheLongConnection = "apacheLong" +) -- Gitblit v1.8.0