fix
zhangqian
2023-09-25 cf96f6bc1fb484fde16bd5ed6d49534c96958022
constvar/const.go
@@ -34,15 +34,32 @@
type PlcMethod string
const (
   PlcMethodModbusTCP PlcMethod = "modbusTCP"
   PlcMethodSerial    PlcMethod = "serial"
   PlcMethodModbusTCP        PlcMethod = "modbusTCP"
   PlcMethodSerial           PlcMethod = "serial"
   PlcMethodModbusTCPChinese PlcMethod = "网络"
   PlcMethodSerialChinese    PlcMethod = "串口"
)
func (slf PlcMethod) Valid() bool {
   return slf == PlcMethodModbusTCP || slf == PlcMethodSerial
func (slf *PlcMethod) ConvertToEnglish() {
   if *slf == PlcMethodModbusTCPChinese {
      *slf = PlcMethodModbusTCP
   }
   if *slf == PlcMethodSerialChinese {
      *slf = PlcMethodSerial
   }
}
func (slf *PlcMethod) Valid() bool {
   return *slf == PlcMethodModbusTCP || *slf == PlcMethodSerial
}
const (
   PlcCacheKeyFinishNumber = "finish_number"
   PlcCacheKeyTotalNumber  = "total_number"
)
const (
   PlcPackageApache               = "apache"
   PlcPackageGoBurrow             = "goBurrow"
   PlcPackageApacheLongConnection = "apacheLong"
)