zhangqian
2023-09-01 1ba32f7b79af42830a2a1f2c488675e8bd25f150
constvar/const.go
@@ -6,13 +6,21 @@
   NsqTopicSendPlcAddress        = "aps.%v.sendPlcAddress"
   NsqTopicProcessParamsRequest  = "aps.%v.processParams.request"
   NsqTopicProcessParamsResponse = "aps.%v.processParams.response"
   NsqTopicApsProcessParams      = "aps.%v.aps.processParams" //有了新的工艺模型
)
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 +28,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"
)