| | |
| | | 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; |
| | |
| | | * 任务指令 |
| | | */ |
| | | private ShuttleAssignCommand assignCommand; |
| | | |
| | | /** |
| | | * 当前小车状态(内部自我维护) |
| | | */ |
| | | private Integer protocolStatus; |
| | | |
| | | /** |
| | | * 当前小车状态枚举 |
| | | */ |
| | | private ShuttleProtocolStatusType protocolStatusType; |
| | | |
| | | /** |
| | | * 源库位 |
| | |
| | | * 错误编号 |
| | | */ |
| | | private Short errorCode; |
| | | |
| | | /** |
| | | * 错误编号枚举 |
| | | */ |
| | | private ShuttleErrorCodeType errorCodeType; |
| | | |
| | | /** |
| | | * Plc输出状态IO |
| | |
| | | } |
| | | |
| | | //获取电池电量 |
| | | public Short getBatteryPower() { |
| | | 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; |
| | | } |
| | | |
| | | } |