From 67c12bf4a11946c07f7c6a9b46a51e46e0da38de Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期二, 14 十一月 2023 19:23:53 +0800
Subject: [PATCH] 工序列表是否可以更新增加工序状态判断
---
constvar/const.go | 135 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 130 insertions(+), 5 deletions(-)
diff --git a/constvar/const.go b/constvar/const.go
index 4f6c64f..d426658 100644
--- a/constvar/const.go
+++ b/constvar/const.go
@@ -1,11 +1,136 @@
package constvar
-type UserStatus int
+const (
+ NsqTopicScheduleTask = "aps.%v.scheduleTask" //鎺掔▼浠诲姟涓嬪彂
+ NsqTopicApsProcessParams = "aps.%v.aps.processParams" //鏈変簡鏂扮殑宸ヨ壓妯″瀷
+ NsqTopicTaskProcedureStatusUpdate = "aps.%v.task.procedure.status" //宸ュ簭鐘舵�佹洿鏂�
+ NsqTopicSyncTaskProgress = "aps.%v.task.procedure.progress" //宸ュ簭鐢熶骇杩涘害
+ NsqTopicDeviceUpdate = "aps.%v.device.update" //璁惧淇℃伅鏇存敼
+ NsqTopicPullDataRequest = "aps.%v.pull.data.request" //鎷夊彇鏁版嵁璇锋眰
+ NsqTopicPullDataResponse = "aps.%v.pull.data.response" //鎷夊彇鏁版嵁鍝嶅簲
+ NsqTopicApsClientReportData = "aps.%v.apsClient.report.data" //apsClient涓婃姤鏁版嵁
+)
-type UserType int
+type PlcStartAddressType int
const (
- UserTypeSuper UserType = iota + 1 // 瓒呯骇绠$悊鍛�
- UserTypePrimary // 涓昏处鎴�
- UserTypeSub // 瀛愯处鎴�
+ PlcStartAddressTypeFinishNumber PlcStartAddressType = 1
+ PlcStartAddressTypeTotalNumber PlcStartAddressType = 2
+)
+
+type PlcStartAddressValueType string
+
+const (
+ PlcStartAddressValueTypeString PlcStartAddressValueType = "string"
+ PlcStartAddressValueTypeInt16 PlcStartAddressValueType = "int16"
+ PlcStartAddressValueTypeInt32 PlcStartAddressValueType = "int32"
+)
+
+const (
+ PlcAddressDataPath = "datafile/"
+ PlcAddressDataKeyFileName = "plc_address_key"
+ PlcAddressDataValueFileName = "plc_address_value"
+)
+
+type PlcMethod string
+
+const (
+ PlcMethodModbusTCP PlcMethod = "modbusTCP"
+ PlcMethodModbusRTU PlcMethod = "modbusRTU"
+ PlcMethodSerial PlcMethod = "serial"
+ PlcMethodModbusTCPChinese PlcMethod = "缃戠粶"
+ PlcMethodSerialChinese PlcMethod = "涓插彛"
+)
+
+func (slf *PlcMethod) ConvertToEnglish() {
+ if *slf == PlcMethodModbusTCPChinese {
+ *slf = PlcMethodModbusTCP
+ }
+ if *slf == PlcMethodSerialChinese {
+ *slf = PlcMethodSerial
+ }
+}
+
+func (slf *PlcMethod) Valid() bool {
+ return *slf == PlcMethodModbusTCP || *slf == PlcMethodSerial || *slf == PlcMethodModbusRTU
+}
+
+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 //涓婁竴涓粨鏉熺殑
+)
+
+type Parity int
+
+const (
+ ParityEven Parity = 1 //濂囨牎楠�
+ ParityOdd Parity = 2 //鍋舵牎楠�
+ ParityNull Parity = 3 //鏃犳牎楠�
+)
+
+func (p Parity) ToString() string {
+ switch p {
+ case ParityEven:
+ return "E"
+ case ParityOdd:
+ return "O"
+ case ParityNull:
+ return "N"
+ }
+ return ""
+}
+
+const (
+ SerfClusterStatusNull = "" //鏈姞鍏ラ泦缇�
+ SerfClusterStatusMaster = "master" //闆嗙兢master
+ SerfClusterStatusSlave = "slave" //闆嗙兢slave
+)
+
+type ProblemCode string
+
+const (
+ ProblemCodeService ProblemCode = "service" //鏈嶅姟涓嶅彲鐢�
+ ProblemCodeNetwork ProblemCode = "network" //缃戠粶閿欒
+ ProblemCodeDB ProblemCode = "db" //鏁版嵁搴撹繛鎺ラ敊璇�
+ ProblemCodeSerf ProblemCode = "serf" //鏈姞鍏erf闆嗙兢
+ ProblemCodeCloud ProblemCode = "cloud" //鏈繛鎺ヤ簯绔�
+ ProblemCodeDevice ProblemCode = "device" //鏈粦瀹氳澶�
+ ProblemCodeProcessModel ProblemCode = "process_model" //宸ヨ壓鍙傛暟缂哄け
+ ProblemCodePlcConfig ProblemCode = "plc_config" //plc閰嶇疆缂哄け
+ ProblemCodePlcAddressList ProblemCode = "plc_address_list" //plc鍦板潃琛ㄧ己澶�
+ 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"
+)
+
+type ReportType int //涓婃姤绫诲瀷
+
+const (
+ ReportTypeSystemDeviceID ReportType = 1
)
--
Gitblit v1.8.0