From 49f56cee1e2285fd32c43f35e3622d2ed6c5fec3 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期六, 26 八月 2023 20:09:07 +0800
Subject: [PATCH] plc tag

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

diff --git a/constvar/const.go b/constvar/const.go
index c64e44b..2ec69ac 100644
--- a/constvar/const.go
+++ b/constvar/const.go
@@ -8,11 +8,18 @@
 	NsqTopicProcessParamsResponse = "aps.%v.processParams.response"
 )
 
-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 (
@@ -20,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