From 2d6875c93b25d0b7336c7fa11e066d213259fe2e Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 25 四月 2024 10:02:01 +0800 Subject: [PATCH] 更改定时任务时区设置 --- constvar/const.go | 67 +++++++++++++++++++++++++++++++-- 1 files changed, 63 insertions(+), 4 deletions(-) diff --git a/constvar/const.go b/constvar/const.go index bb73e7e..d92819b 100644 --- a/constvar/const.go +++ b/constvar/const.go @@ -8,20 +8,36 @@ NsqTopicDeviceUpdate = "aps.%v.device.update" //璁惧淇℃伅鏇存敼 NsqTopicPullDataRequest = "aps.%v.pull.data.request" //鎷夊彇鏁版嵁璇锋眰 NsqTopicPullDataResponse = "aps.%v.pull.data.response" //鎷夊彇鏁版嵁鍝嶅簲 + NsqTopicApsClientReportData = "aps.%v.apsClient.report.data" //apsClient涓婃姤鏁版嵁 + NsqTopicSendDashboardData = "aps.%v.apsClient.dashboard" //涓嬪彂dashboard鏁版嵁 ) type PlcStartAddressType int const ( - PlcStartAddressTypeFinishNumber PlcStartAddressType = 1 - PlcStartAddressTypeTotalNumber PlcStartAddressType = 2 + PlcStartAddressTypeFinishNumber PlcStartAddressType = 1 + PlcStartAddressTypeTotalNumber PlcStartAddressType = 2 + PlcStartAddressTypeTotalNumberWrite PlcStartAddressType = 3 ) + +type EndianType string + +const ( + EndianTypeBig EndianType = "big" + EndianTypeLittle EndianType = "little" + EndianTypeMix EndianType = "mix" +) + +func (t EndianType) Valid() bool { + return t == EndianTypeBig || t == EndianTypeLittle || t == EndianTypeMix +} type PlcStartAddressValueType string const ( PlcStartAddressValueTypeString PlcStartAddressValueType = "string" - PlcStartAddressValueTypeInt PlcStartAddressValueType = "int" + PlcStartAddressValueTypeInt16 PlcStartAddressValueType = "int16" + PlcStartAddressValueTypeInt32 PlcStartAddressValueType = "int32" ) const ( @@ -80,7 +96,7 @@ ParityNull Parity = 3 //鏃犳牎楠� ) -func (p Parity) String() string { +func (p Parity) ToString() string { switch p { case ParityEven: return "E" @@ -97,3 +113,46 @@ 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 + ReportTypeReportWork ReportType = 2 +) + +type SyncStatus int //鍚屾鐘舵�� + +const ( + SyncStatusWait SyncStatus = 1 //寰呭悓姝� + SyncStatusOk SyncStatus = 2 //宸插畬鎴� +) -- Gitblit v1.8.0