| | |
| | | package common |
| | | |
| | | import "github.com/shopspring/decimal" |
| | | import ( |
| | | "apsClient/constvar" |
| | | "github.com/shopspring/decimal" |
| | | ) |
| | | |
| | | // 排程任务下发 |
| | | type ( |
| | |
| | | StartTime int64 `gorm:"comment:计划开始时间" json:"startTime"` |
| | | EndTime int64 `gorm:"comment:计划结束时间" json:"endTime"` |
| | | WorkHours decimal.Decimal `gorm:"type:decimal(35,18);comment:工时" json:"workHours"` |
| | | InputMaterials []*ProcedureMaterial `json:"inputMaterials"` // 输入物料列表 |
| | | OutputMaterials []*ProcedureMaterial `json:"outputMaterials"` // 输出物料列表 |
| | | Workers []*ProcedureWorker `json:"workers"` // 人员列表 |
| | | InputMaterials []*ProcedureMaterial `json:"inputMaterials"` // 输入物料列表 |
| | | OutputMaterials []*ProcedureMaterial `json:"outputMaterials"` // 输出物料列表 |
| | | Workers []*ProcedureWorker `json:"workers"` // 人员列表 |
| | | AllProcedureNames []string `json:"allProcedureNames"` // 所属工单工序列表 |
| | | Channel int32 `json:"channel"` //通道序号 |
| | | } |
| | | |
| | | DeliverScheduleTask struct { |
| | |
| | | DeviceId string |
| | | } |
| | | ResponsePlcAddress struct { |
| | | KeyData []byte |
| | | AddressData []byte |
| | | KeyData []byte |
| | | AddressData []byte |
| | | DeviceId string |
| | | PlcAddressList []*PlcAddress //plc 完成量,总量, 读写地址 |
| | | PlcConfig PlcConfig //用网口还是端口以及网口ip port |
| | | } |
| | | |
| | | 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:"-"` |
| | | Details []*PlcAddress `gorm:"-" json:"details"` |
| | | } |
| | | |
| | | PlcAddress struct { |
| | | DeviceID string `json:"deviceID"` // 设备id |
| | | Channel int `json:"channel"` // 生产通道on,一个机器可能有多个机位,需要分别配置plc地址 |
| | | StartAddress int `json:"startAddress"` // 数据起始地址 |
| | | Length int `json:"length"` // 数据长度 |
| | | Type string `json:"type"` // 数据类型 |
| | | FieldName constvar.PlcStartAddressType `json:"fieldName"` // 对应系统字段,完成量或总量 |
| | | } |
| | | ) |
| | | |
| | |
| | | DeviceId string `json:"deviceId" gorm:"-"` //用于过滤获取nsq消息 |
| | | } |
| | | ) |
| | | |
| | | // MsgTaskStatusUpdate 任务状态改变 |
| | | type MsgTaskStatusUpdate struct { |
| | | WorkOrderId string `json:"workOrderId"` //工单编号 |
| | | ProcedureID string `json:"procedureId"` // 工序 |
| | | DeviceId string `json:"deviceId"` //用于过滤获取nsq消息 |
| | | IsProcessing bool //是否处理中 |
| | | IsFinish bool //是否完成 |
| | | } |