| | |
| | | } |
| | | |
| | | StaProtocol staProtocol = devpThread.getStation().get(112); |
| | | if (staProtocol == null || staProtocol.getWorkNo() == 0) { |
| | | StaProtocol staProtocol2 = devpThread.getStation().get(116); |
| | | StaProtocol staProtocol3 = devpThread.getStation().get(117); |
| | | if(Objects.equals(staProtocol3.getWorkNo(), staProtocol.getWorkNo()) && staProtocol.getWorkNo() != 0){ |
| | | staProtocol.setWorkNo((short) 0); |
| | | staProtocol.setStaNo((short) 0); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | Thread.sleep(100); // 让 PLC 识别变化 |
| | | } |
| | | if (staProtocol == null || staProtocol.getWorkNo() == 0 || !staProtocol.isLoading() ) { |
| | | continue; |
| | | } |
| | | |
| | | if(staProtocol.getStaNo() != 112){ |
| | | continue; |
| | | } |
| | | if(staProtocol.getWorkNo() == staProtocol2.getWorkNo()) { |
| | | continue; |
| | | } |
| | | // 查询任务信息 |
| | | TaskWrk taskWrk = taskWrkMapper.selectStaWorking(Integer.valueOf(staProtocol.getWorkNo())); |
| | | if (taskWrk == null || taskWrk.getWrkNo() < 6001 || taskWrk.getWrkNo() > 9000) { |
| | |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setStaNo(Short.valueOf(taskWrk.getTargetPoint())); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | Thread.sleep(200); |
| | | |
| | | log.info("Shifted from cycle station 112 to target {}, workNo: {}", taskWrk.getTargetPoint(), workNo); |
| | | } |