| | |
| | | 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 ( |