From 8dfb8feb32bb5e4e460e23dcde42612a26fa2bcb Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期日, 27 八月 2023 01:11:28 +0800
Subject: [PATCH] fix

---
 constvar/const.go |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/constvar/const.go b/constvar/const.go
index 20868e5..2ec69ac 100644
--- a/constvar/const.go
+++ b/constvar/const.go
@@ -8,10 +8,18 @@
 	NsqTopicProcessParamsResponse = "aps.%v.processParams.response"
 )
 
-type PlcStartAddressType string
+type PlcStartAddressType int
 
 const (
-	PlcStartAddressTypeFinishNumber = "1"
+	PlcStartAddressTypeFinishNumber PlcStartAddressType = 1
+	PlcStartAddressTypeTotalNumber  PlcStartAddressType = 2
+)
+
+type PlcStartAddressValueType string
+
+const (
+	PlcStartAddressValueTypeString PlcStartAddressValueType = "string"
+	PlcStartAddressValueTypeInt    PlcStartAddressValueType = "int"
 )
 
 const (
@@ -19,3 +27,19 @@
 	PlcAddressDataKeyFileName   = "plc_address_key"
 	PlcAddressDataValueFileName = "plc_address_value"
 )
+
+type PlcMethod string
+
+const (
+	PlcMethodModbusTCP PlcMethod = "modbusTCP"
+	PlcMethodSerial    PlcMethod = "serial"
+)
+
+func (slf PlcMethod) Valid() bool {
+	return slf == PlcMethodModbusTCP || slf == PlcMethodSerial
+}
+
+const (
+	PlcCacheKeyFinishNumber = "finish_number"
+	PlcCacheKeyTotalNumber  = "total_number"
+)

--
Gitblit v1.8.0