| | |
| | | package constvar |
| | | |
| | | const ( |
| | | NsqTopicScheduleTask = "aps.%v.scheduleTask" //排程任务下发 |
| | | NsqTopicGetPlcAddress = "aps.%v.getPlcAddress" |
| | | NsqTopicSendPlcAddress = "aps.%v.sendPlcAddress" |
| | | NsqTopicProcessParamsRequest = "aps.%v.processParams.request" |
| | | NsqTopicProcessParamsResponse = "aps.%v.processParams.response" |
| | | NsqTopicScheduleTask = "aps.%v.scheduleTask" //排程任务下发 |
| | | NsqTopicApsProcessParams = "aps.%v.aps.processParams" //有了新的工艺模型 |
| | | NsqTopicTaskProcedureStatusUpdate = "aps.%v.task.procedure.status" //工序状态更新 |
| | | NsqTopicSyncTaskProgress = "aps.%v.task.procedure.progress" //工序生产进度 |
| | | NsqTopicDeviceUpdate = "aps.%v.device.update" //设备信息更改 |
| | | NsqTopicPullDataRequest = "aps.%v.pull.data.request" //拉取数据请求 |
| | | NsqTopicPullDataResponse = "aps.%v.pull.data.response" //拉取数据响应 |
| | | ) |
| | | |
| | | type PlcStartAddressType int |
| | |
| | | |
| | | const ( |
| | | PlcMethodModbusTCP PlcMethod = "modbusTCP" |
| | | PlcMethodModbusRTU PlcMethod = "modbusRTU" |
| | | PlcMethodSerial PlcMethod = "serial" |
| | | PlcMethodModbusTCPChinese PlcMethod = "网络" |
| | | PlcMethodSerialChinese PlcMethod = "串口" |
| | |
| | | } |
| | | |
| | | func (slf *PlcMethod) Valid() bool { |
| | | return *slf == PlcMethodModbusTCP || *slf == PlcMethodSerial |
| | | return *slf == PlcMethodModbusTCP || *slf == PlcMethodSerial || *slf == PlcMethodModbusRTU |
| | | } |
| | | |
| | | const ( |
| | |
| | | TaskModeCurrent TaskMode = 2 //未开始的和进行中的 |
| | | TaskModeLastFinished TaskMode = 3 //上一个结束的 |
| | | ) |
| | | |
| | | type Parity int |
| | | |
| | | const ( |
| | | ParityEven Parity = 1 //奇校验 |
| | | ParityOdd Parity = 2 //偶校验 |
| | | ParityNull Parity = 3 //无校验 |
| | | ) |
| | | |
| | | func (p Parity) String() string { |
| | | switch p { |
| | | case ParityEven: |
| | | return "E" |
| | | case ParityOdd: |
| | | return "O" |
| | | case ParityNull: |
| | | return "N" |
| | | } |
| | | return "" |
| | | } |