| | |
| | | |
| | | /////////////////////////////////////RGV调度///////////////////////////////////// |
| | | |
| | | public synchronized void taskCreate() { |
| | | for (RgvSlave rgvSlave : slaveProperties.getRgv()) { |
| | | try { |
| | | for (RgvSlave.RgvStn inSta : rgvSlave.getRgvInSta()) { |
| | | boolean create = deviceDetectionCreate(inSta); |
| | | if (create) { |
| | | continue; |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | } |
| | | public synchronized void taskStart() { |
| | | for (RgvSlave rgvSlave : slaveProperties.getRgv()) { |
| | | try { |
| | |
| | | return true; |
| | | } |
| | | |
| | | public boolean deviceDetectionCreate(RgvSlave.RgvStn inSta) { |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, inSta.getDevpPlcId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | return false; |
| | | } |
| | | // 判断是否满足取货条件 |
| | | if (staProtocol.isAutoing() |
| | | // && staProtocol.isLoading() |
| | | // && staProtocol.isStaOk() |
| | | && staProtocol.getWorkNo() != 0) { |
| | | TaskWrk taskWrk = taskWrkService.selectByTaskNo(staProtocol.getWorkNo()); |
| | | if (Cools.isEmpty(taskWrk)){ |
| | | if (inSta.getStaNo()==117 || inSta.getStaNo()==120 || inSta.getStaNo()==123 |
| | | || inSta.getStaNo()==217 || inSta.getStaNo()==220 || inSta.getStaNo()==223){ |
| | | WrkMast wrkMast = wrkMastService.selectByWrkNo(staProtocol.getWorkNo()); |
| | | if (!Cools.isEmpty(wrkMast) && wrkMast.getIoType()<100){ |
| | | return true; |
| | | } |
| | | } else { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | public TaskWrk deviceDetection(RgvSlave.RgvStn inSta) { |
| | | |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, inSta.getDevpPlcId()); |
| | |
| | | // && staProtocol.isLoading() |
| | | // && staProtocol.isStaOk() |
| | | && staProtocol.getWorkNo() != 0) { |
| | | TaskWrk taskWrk = taskWrkService.selectByWrkNo(staProtocol.getWorkNo()); |
| | | TaskWrk taskWrk = taskWrkService.selectByTaskNo(staProtocol.getWorkNo()); |
| | | if (taskWrk != null) { |
| | | Integer stano = staProtocol.getStaNo().intValue(); |
| | | if (staProtocol.getSiteId() == 1004 || staProtocol.getSiteId()==1020){ |
| | |
| | | // 判断是否满足取货条件 |
| | | if (staProtocolOther.isAutoing() |
| | | && staProtocolOther.getWorkNo() != 0) { |
| | | TaskWrk taskWrkOther = taskWrkService.selectByWrkNo(staProtocolOther.getWorkNo()); |
| | | TaskWrk taskWrkOther = taskWrkService.selectByTaskNo(staProtocolOther.getWorkNo()); |
| | | if (taskWrkOther != null) { |
| | | return taskWrkOther; |
| | | } |