| | |
| | | } |
| | | |
| | | PlcConfig struct { |
| | | Brand string `gorm:"type:varchar(191);comment:PLC品牌" json:"brand"` |
| | | Method constvar.PlcMethod `gorm:"type:varchar(191);comment:接口方式" json:"method"` |
| | | Address string `gorm:"type:varchar(191);comment:PLC地址" json:"address"` //plc ip地址, method = modbusTCP用 |
| | | Port int `gorm:"type:int(11);comment:端口" json:"port"` //plc 端口号, method = modbusTCP用 |
| | | BaudRate int `gorm:"type:int(11);comment:波特率" json:"baudRate"` //串口波特率, method = serial时 用 |
| | | SerialName string `gorm:"type:int(11);comment:串口名称" json:"serialName"` //串口名称,method = serial时 用 |
| | | IsOpen bool `gorm:"type:tinyint(1);comment:是否开启" json:"isOpen"` |
| | | Detail string `gorm:"type:varchar(2048);comment:数据详情" json:"-"` |
| | | Brand string `gorm:"type:varchar(191)" json:"brand"` //comment:PLC品牌 |
| | | Method constvar.PlcMethod `gorm:"type:varchar(191)" json:"method"` //comment:接口方式 |
| | | Address string `gorm:"type:varchar(191)" json:"address"` //plc ip地址, method = modbusTCP用 |
| | | Port int `gorm:"type:int(11)" json:"port"` //plc 端口号, method = modbusTCP用 |
| | | BaudRate int `gorm:"type:int(11)" json:"baudRate"` //串口波特率, method = serial时 用 |
| | | SerialName string `gorm:"type:int(11)" json:"serialName"` //串口名称,method = serial时 用 |
| | | IsOpen bool `gorm:"type:tinyint(1)" json:"isOpen"` |
| | | Detail string `gorm:"type:varchar(2048)" json:"-"` |
| | | Details []*PlcAddress `gorm:"-" json:"details"` |
| | | } |
| | | |
| | |
| | | ProcedureName string `gorm:"type:varchar(191);comment:工序名称" json:"procedureName"` |
| | | DeviceID string `gorm:"index;type:varchar(191);not null;comment:设备ID" json:"deviceId"` |
| | | } |
| | | |
| | | type PullDataType string |
| | | |
| | | const ( |
| | | PullDataTypeProcessModel = "process_model" |
| | | ) |
| | | |
| | | // MsgPullDataRequest 拉取云端数据 |
| | | type MsgPullDataRequest struct { |
| | | DataType PullDataType `json:"dataType"` //要拉取的数据类型 |
| | | } |
| | | |
| | | type MsgPullDataResponse struct { |
| | | DataType PullDataType `json:"dataType"` //要拉取的数据类型 |
| | | Data interface{} //返回的数据 |
| | | } |