| | |
| | | import com.zy.asrs.wcs.core.entity.BasLift; |
| | | import com.zy.asrs.wcs.core.model.command.LiftCommand; |
| | | import com.zy.asrs.wcs.core.model.enums.LiftCommandModeType; |
| | | import com.zy.asrs.wcs.core.model.enums.MotionCtgType; |
| | | import com.zy.asrs.wcs.core.service.BasLiftService; |
| | | import com.zy.asrs.wcs.rcs.News; |
| | | import com.zy.asrs.wcs.rcs.cache.OutputQueue; |
| | |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | @SuppressWarnings("all") |
| | |
| | | //有托盘 |
| | | liftProtocol.setHasTray(data.getString("haveCargo").equals("Y")); |
| | | //有小车 |
| | | liftProtocol.setHasCar(data.getString("haveCar").equals("Y")); |
| | | liftProtocol.setHasCar(data.getInteger("haveCar") == 1); |
| | | //故障码 |
| | | liftProtocol.setErrorCode("0"); |
| | | //层 |
| | | liftProtocol.setLev(data.getInteger("curFloor")); |
| | | //已完成的任务号 |
| | | liftProtocol.setCompleteTaskNo(data.getString("completeTaskNo")); |
| | | |
| | | |
| | | //************补充扩展字段************* |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean isIdle(ExecuteSupport support) { |
| | | if (null != support) { |
| | | if (!support.judgement()) { |
| | | return false; |
| | | public boolean isIdle(MotionCtgType flag) { |
| | | if (flag == null) { |
| | | InnerLiftExtend extend = (InnerLiftExtend) this.liftProtocol.getExtend();//获取扩展字段 |
| | | // 判断提升机是否自动、就绪、空闲、未锁定 |
| | | if (this.liftProtocol.getModel() |
| | | && !this.liftProtocol.getRun() |
| | | && this.liftProtocol.getPakMk() |
| | | && this.liftProtocol.getReady() |
| | | && this.liftProtocol.getErrorCode().equals("0") |
| | | && (this.liftProtocol.getProtocolStatusType().equals(LiftProtocolStatusType.IDLE) |
| | | || this.liftProtocol.getProtocolStatusType().equals(LiftProtocolStatusType.WAITING)) |
| | | && !extend.getLock() |
| | | ) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | switch (Objects.requireNonNull(MotionCtgType.get(String.valueOf(flag)))){ |
| | | case SHUTTLE_MOVE_FROM_LIFT://穿梭车出提升机 |
| | | case SHUTTLE_MOVE_TO_LIFT://穿梭车进提升机 |
| | | case LIFT_SHUTTLE_ARRIVAL://提升机解锁 |
| | | return isIdleShuttleMoveToLift(); |
| | | case LIFT_LOCK://提升机锁定 |
| | | case LIFT_UNLOCK://提升机解锁 |
| | | return isIdleLiftLock(); |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | //穿梭车进提升机时-提升机状态判断 |
| | | private boolean isIdleShuttleMoveToLift() { |
| | | InnerLiftExtend extend = (InnerLiftExtend) this.liftProtocol.getExtend();//获取扩展字段 |
| | | // 判断提升机是否自动、就绪、空闲、未锁定 |
| | | // 判断提升机是否自动、就绪、空闲 |
| | | if (this.liftProtocol.getModel() |
| | | && !this.liftProtocol.getRun() |
| | | && this.liftProtocol.getPakMk() |
| | | && this.liftProtocol.getReady() |
| | | && this.liftProtocol.getErrorCode().equals("0") |
| | | && (this.liftProtocol.getProtocolStatusType().equals(LiftProtocolStatusType.IDLE) |
| | | || this.liftProtocol.getProtocolStatusType().equals(LiftProtocolStatusType.WAITING)) |
| | | && !extend.getLock() |
| | | ) { |
| | | if (!extend.getLock()) { |
| | | //提升机未锁定,需要判断是否就绪 |
| | | if (!this.liftProtocol.getReady()) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | //提升机锁定-提升机状态判断 |
| | | private boolean isIdleLiftLock() { |
| | | // 判断提升机是否自动、就绪、空闲 |
| | | if (this.liftProtocol.getModel() |
| | | && !this.liftProtocol.getRun() |
| | | && this.liftProtocol.getPakMk() |
| | | && this.liftProtocol.getErrorCode().equals("0") |
| | | && (this.liftProtocol.getProtocolStatusType().equals(LiftProtocolStatusType.IDLE) |
| | | || this.liftProtocol.getProtocolStatusType().equals(LiftProtocolStatusType.WAITING)) |
| | | ) { |
| | | return true; |
| | | } |