| | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasShuttle; |
| | | import com.zy.asrs.service.BasShuttleService; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.utils.NavigatePositionConvert; |
| | | import com.zy.core.News; |
| | | import com.zy.core.enums.ShuttleErrorCodeType; |
| | |
| | | /** |
| | | * 作业标记 |
| | | */ |
| | | private Boolean pakMk = true; |
| | | private Boolean pakMk = false; |
| | | |
| | | /** |
| | | * 手动状态/自动状态 |
| | |
| | | private NyShuttlePointClass coord; |
| | | |
| | | /** |
| | | * WCS库位xyz |
| | | */ |
| | | private NyShuttlePointClass wcsPoint; |
| | | |
| | | /** |
| | | * 任务目的库位xyztaskId(正在动作的任务ID)lastTaskId(最后一个完成的任务ID)recentTaskId(收到的最后一个任务ID) |
| | | */ |
| | | private TaskClass task; |
| | |
| | | * 非自动状态时间计时(S) |
| | | */ |
| | | private Integer errTime; |
| | | |
| | | /** |
| | | * 独占令牌 |
| | | * 未被任务占据,令牌为0 |
| | | * 被任务占据,将任务号赋值给令牌 |
| | | */ |
| | | private Integer token = 0; |
| | | |
| | | //总里程数 |
| | | @Data |
| | |
| | | String locNo = NavigatePositionConvert.nyXyzToLocNo(point.getX(), point.getY(), point.getZ()); |
| | | this.point = point; |
| | | this.currentLocNo = locNo; |
| | | NyShuttlePointClass wcsPoint = new NyShuttlePointClass(); |
| | | wcsPoint.setX(Utils.getRow(locNo)); |
| | | wcsPoint.setY(Utils.getBay(locNo)); |
| | | wcsPoint.setZ(Utils.getLev(locNo)); |
| | | this.wcsPoint = wcsPoint; |
| | | } |
| | | |
| | | // 是否处于空闲待命状态 |
| | | public Boolean isIdle() { |
| | | boolean res = this.free == ShuttleStatusType.IDLE.id |
| | | && this.pakMk.equals(true) |
| | | && !this.pakMk |
| | | && this.errState == 0 |
| | | && this.taskNo == 0 |
| | | && this.protocolStatus == ShuttleProtocolStatusType.IDLE.id |
| | |
| | | // 是否处于空闲待命状态,传入的taskNo和当前taskNo相同时允许放行 |
| | | public Boolean isIdle(int taskNo) { |
| | | boolean res = this.free == ShuttleStatusType.IDLE.id |
| | | && this.pakMk.equals(true) |
| | | && !this.pakMk |
| | | && this.errState == 0 |
| | | && (this.taskNo == 0 || this.taskNo == taskNo) |
| | | && this.protocolStatus.intValue() == ShuttleProtocolStatusType.IDLE.id |
| | |
| | | // 是否处于空闲待命状态 |
| | | public Boolean isIdleNoCharge() { |
| | | boolean res = this.free == ShuttleStatusType.IDLE.id |
| | | && this.pakMk.equals(true) |
| | | && !this.pakMk |
| | | && this.errState == 0 |
| | | && this.taskNo == 0 |
| | | && this.protocolStatus == ShuttleProtocolStatusType.IDLE.id |
| | |
| | | } |
| | | |
| | | boolean res = this.free == ShuttleStatusType.IDLE.id |
| | | && this.pakMk |
| | | && !this.pakMk |
| | | && this.errState == 0 |
| | | && this.taskNo == 0 |
| | | && this.protocolStatusType.id == ShuttleProtocolStatusType.IDLE.id |