| | |
| | | NsqTopicDeviceUpdate = "aps.%v.device.update" //设备信息更改 |
| | | NsqTopicPullDataRequest = "aps.%v.pull.data.request" //拉取数据请求 |
| | | NsqTopicPullDataResponse = "aps.%v.pull.data.response" //拉取数据响应 |
| | | NsqTopicApsClientReportData = "aps.%v.apsClient.report.data" //apsClient上报数据 |
| | | NsqTopicSendDashboardData = "aps.%v.apsClient.dashboard" //下发dashboard数据 |
| | | ) |
| | | |
| | | type PlcStartAddressType int |
| | | |
| | | const ( |
| | | PlcStartAddressTypeFinishNumber PlcStartAddressType = 1 |
| | | PlcStartAddressTypeTotalNumber PlcStartAddressType = 2 |
| | | PlcStartAddressTypeFinishNumber PlcStartAddressType = 1 |
| | | PlcStartAddressTypeTotalNumber PlcStartAddressType = 2 |
| | | PlcStartAddressTypeTotalNumberWrite PlcStartAddressType = 3 |
| | | ) |
| | | |
| | | type PlcStartAddressValueType string |
| | | |
| | | const ( |
| | | PlcStartAddressValueTypeString PlcStartAddressValueType = "string" |
| | | PlcStartAddressValueTypeInt PlcStartAddressValueType = "int" |
| | | PlcStartAddressValueTypeInt16 PlcStartAddressValueType = "int16" |
| | | PlcStartAddressValueTypeInt32 PlcStartAddressValueType = "int32" |
| | | ) |
| | | |
| | | const ( |
| | |
| | | ParityNull Parity = 3 //无校验 |
| | | ) |
| | | |
| | | func (p Parity) String() string { |
| | | func (p Parity) ToString() string { |
| | | switch p { |
| | | case ParityEven: |
| | | return "E" |
| | |
| | | SerfClusterStatusMaster = "master" //集群master |
| | | SerfClusterStatusSlave = "slave" //集群slave |
| | | ) |
| | | |
| | | type ProblemCode string |
| | | |
| | | const ( |
| | | ProblemCodeService ProblemCode = "service" //服务不可用 |
| | | ProblemCodeNetwork ProblemCode = "network" //网络错误 |
| | | ProblemCodeDB ProblemCode = "db" //数据库连接错误 |
| | | ProblemCodeSerf ProblemCode = "serf" //未加入serf集群 |
| | | ProblemCodeCloud ProblemCode = "cloud" //未连接云端 |
| | | ProblemCodeDevice ProblemCode = "device" //未绑定设备 |
| | | ProblemCodeProcessModel ProblemCode = "process_model" //工艺参数缺失 |
| | | ProblemCodePlcConfig ProblemCode = "plc_config" //plc配置缺失 |
| | | ProblemCodePlcAddressList ProblemCode = "plc_address_list" //plc地址表缺失 |
| | | ProblemCodePlcProcessModelAddressList ProblemCode = "plc_process_model_address_list" //plc地址表缺失 |
| | | ProblemCodePlcConnect ProblemCode = "plc_connect" //plc连接失败 |
| | | ) |
| | | |
| | | type SystemStatusKey string |
| | | |
| | | const ( |
| | | SystemStatusKeyNsq SystemStatusKey = "nsq" |
| | | ) |
| | | |
| | | type SystemStatusValue string |
| | | |
| | | const ( |
| | | SystemStatusValueNormal SystemStatusValue = "1" |
| | | SystemStatusValueUnNormal SystemStatusValue = "2" |
| | | ) |
| | | |
| | | type ReportType int //上报类型 |
| | | |
| | | const ( |
| | | ReportTypeSystemDeviceID ReportType = 1 |
| | | ReportTypeReportWork ReportType = 2 |
| | | ) |
| | | |
| | | type SyncStatus int //同步状态 |
| | | |
| | | const ( |
| | | SyncStatusWait SyncStatus = 1 //待同步 |
| | | SyncStatusOk SyncStatus = 2 //已完成 |
| | | ) |