| | |
| | | continue; |
| | | } |
| | | vo.setWorkNo(crnProtocol.getTaskNo()); // 任务号 |
| | | if (crnProtocol.getTaskNo()>0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(crnProtocol.getTaskNo()); |
| | | if (wrkMast != null) { |
| | | vo.setStatusType(CrnStatusType.process(wrkMast.getIoType()).getDesc()); // 模式状态 |
| | | } |
| | | } else { |
| | | vo.setStatusType(crnProtocol.modeType.equals(CrnModeType.AUTO)? CrnStatusType.MACHINE_AUTO.getDesc(): CrnStatusType.MACHINE_UN_AUTO.getDesc()); // 模式状态 |
| | | } |
| | | // if (crnProtocol.getTaskNo()>0) { |
| | | // WrkMast wrkMast = wrkMastService.selectById(crnProtocol.getTaskNo()); |
| | | // if (wrkMast != null) { |
| | | // vo.setStatusType(CrnStatusType.process(wrkMast.getIoType()).getDesc()); // 模式状态 |
| | | // } |
| | | // } else { |
| | | // |
| | | // } |
| | | vo.setStatusType(crnProtocol.modeType.desc); // 模式状态 |
| | | vo.setStatus(crnProtocol.getStatusType().desc); // 状态 |
| | | vo.setLoading(crnProtocol.getLoaded()==1?"有物":"无物"); // 有物 |
| | | vo.setBay(crnProtocol.getBay()); // 列 |
| | |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | // 只在连线模式下记录 |
| | | if (crnProtocol.getModeType() == CrnModeType.AUTO) { |
| | | if (crnProtocol.getModeType() != CrnModeType.STOP) { |
| | | // 有任务 |
| | | if (crnProtocol.getTaskNo() != 0) { |
| | | BasErrLog latest = basErrLogService.findLatestByTaskNo(crn.getId(), crnProtocol.getTaskNo().intValue()); |
| | |
| | | |
| | | public enum CrnModeType { |
| | | |
| | | STOP(0), // 停机状态 |
| | | HAND(1), // 手动模式中 |
| | | HALF_AUTO(2), // 半自动模式中 |
| | | AUTO(3), // 电脑模式中/自动模式 |
| | | STOP(0, "停机状态"), // 停机状态 |
| | | HAND(1, "手动模式"), // 手动模式中 |
| | | HALF_AUTO(2, "半自动模式"), // 半自动模式中 |
| | | AUTO(3, "电脑模式"), // 电脑模式中/自动模式 |
| | | ; |
| | | |
| | | public Integer id; |
| | | CrnModeType(Integer id) { |
| | | public String desc; |
| | | CrnModeType(Integer id, String desc) { |
| | | this.id = id; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static CrnModeType get(Short id) { |