From 81cda4f09d4c0fff6edd087d1c49d05cb6eaab38 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期一, 09 十月 2023 20:47:27 +0800 Subject: [PATCH] 当前使用的工艺编号置顶 --- constvar/const.go | 65 ++++++++++++++++++++++++++------ 1 files changed, 53 insertions(+), 12 deletions(-) diff --git a/constvar/const.go b/constvar/const.go index 087eeb5..6bea5e5 100644 --- a/constvar/const.go +++ b/constvar/const.go @@ -1,18 +1,29 @@ 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" + 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" //宸ュ簭鐢熶骇杩涘害 + NsqTopicDeviceUpdate = "aps.%v.device.update" //璁惧淇℃伅鏇存敼 ) -type PlcStartAddressType string +type PlcStartAddressType int const ( - PlcStartAddressTypeFinishNumber = 1 - PlcStartAddressTypeTotalNumber = 2 + PlcStartAddressTypeFinishNumber PlcStartAddressType = 1 + PlcStartAddressTypeTotalNumber PlcStartAddressType = 2 +) + +type PlcStartAddressValueType string + +const ( + PlcStartAddressValueTypeString PlcStartAddressValueType = "string" + PlcStartAddressValueTypeInt PlcStartAddressValueType = "int" ) const ( @@ -24,10 +35,40 @@ 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" +) + +type TaskMode int + +const ( + TaskModeUnStarted TaskMode = 1 //鏈紑濮嬬殑 + TaskModeCurrent TaskMode = 2 //鏈紑濮嬬殑鍜岃繘琛屼腑鐨� + TaskModeLastFinished TaskMode = 3 //涓婁竴涓粨鏉熺殑 +) -- Gitblit v1.8.0