From ef7d02ce56e98e8cbc5ed6ec746ea39bf0b8c9e2 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期六, 16 九月 2023 22:44:58 +0800 Subject: [PATCH] 增加实时获取生产进度接口 --- constvar/const.go | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-) diff --git a/constvar/const.go b/constvar/const.go index 9f21401..eb2f630 100644 --- a/constvar/const.go +++ b/constvar/const.go @@ -6,8 +6,9 @@ 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" //宸ュ簭鐘舵�佹洿鏂� + NsqTopicApsProcessParams = "aps.%v.aps.processParams" //鏈変簡鏂扮殑宸ヨ壓妯″瀷 + NsqTopicTaskProcedureStatusUpdate = "aps.%v.task.procedure.status" //宸ュ簭鐘舵�佹洿鏂� + NsqTopicSyncTaskProgress = "aps.%v.task.procedure.progress" //宸ュ簭鐢熶骇杩涘害 ) type PlcStartAddressType int @@ -33,12 +34,23 @@ 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 ( -- Gitblit v1.8.0