| | |
| | | package com.zy.core.model.protocol; |
| | | |
| | | import com.zy.core.enums.ShuttleErrorCodeType; |
| | | import com.zy.core.enums.ShuttleProtocolStatusType; |
| | | import com.zy.core.enums.ShuttleStatusType; |
| | | import com.zy.core.model.command.ShuttleAssignCommand; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | /** |
| | | * 任务号 |
| | | */ |
| | | public Short taskNo = 0; |
| | | private Short taskNo = 0; |
| | | |
| | | /** |
| | | * 排 |
| | | * 任务指令 |
| | | */ |
| | | public Short row; |
| | | private ShuttleAssignCommand assignCommand; |
| | | |
| | | /** |
| | | * 列 |
| | | * 当前小车状态(内部自我维护) |
| | | */ |
| | | public Short bay; |
| | | private Integer protocolStatus; |
| | | |
| | | /** |
| | | * 层 |
| | | * 当前小车状态枚举 |
| | | */ |
| | | public Short lev; |
| | | private ShuttleProtocolStatusType protocolStatusType; |
| | | |
| | | /** |
| | | * 源库位 |
| | | */ |
| | | private String sourceLocNo; |
| | | |
| | | /** |
| | | * 目标库位 |
| | | */ |
| | | private String locNo; |
| | | |
| | | /** |
| | | * 小车忙状态位 |
| | |
| | | * 错误编号 |
| | | */ |
| | | private Short errorCode; |
| | | |
| | | /** |
| | | * 错误编号枚举 |
| | | */ |
| | | private ShuttleErrorCodeType errorCodeType; |
| | | |
| | | /** |
| | | * Plc输出状态IO |
| | |
| | | /** |
| | | * 作业标记 |
| | | */ |
| | | private String pakMk = "-"; |
| | | private Boolean pakMk = true; |
| | | |
| | | // 任务信息 --------------------------------------------------------- |
| | | /** |
| | |
| | | this.busyStatusType = type; |
| | | } |
| | | |
| | | //获取电池电量 |
| | | public Short getBatteryPower$() { |
| | | return (short) (this.batteryPower * 0.1); |
| | | } |
| | | |
| | | //获取电池温度 |
| | | public Short getBatteryTemp$() { |
| | | return (short) (this.batteryTemp * 0.1); |
| | | } |
| | | |
| | | /** |
| | | * 设置小车状态 |
| | | */ |
| | | public void setProtocolStatus(Integer status) { |
| | | this.protocolStatus = status; |
| | | this.protocolStatusType = ShuttleProtocolStatusType.get(status); |
| | | } |
| | | |
| | | /** |
| | | * 设置小车状态 |
| | | */ |
| | | public void setProtocolStatus(ShuttleProtocolStatusType status) { |
| | | this.protocolStatus = status.id; |
| | | this.protocolStatusType = status; |
| | | } |
| | | |
| | | /** |
| | | * 设置错误编号 |
| | | */ |
| | | public void setErrorCode(Short errorCode) { |
| | | this.errorCode = errorCode; |
| | | this.errorCodeType = ShuttleErrorCodeType.get(errorCode.intValue()); |
| | | } |
| | | |
| | | /** |
| | | * 设置错误编号 |
| | | */ |
| | | public void setErrorCode(ShuttleErrorCodeType type) { |
| | | this.errorCode = type.id.shortValue(); |
| | | this.errorCodeType = type; |
| | | } |
| | | |
| | | } |