| | |
| | | devpThread.startSignal[i][0] = newSingle; |
| | | } |
| | | } |
| | | try{ |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("channel",(i+1))); |
| | | messageQueueOffer2(i,(short)((int)locMast.getFireStatus()),SlaveType.Devp, devp.getId()); |
| | | }catch (Exception e){ |
| | | log.error("火警 ===>> 给输送线发送警报失败,通道号:", i+1); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | staProtocol.setSiteId(i*2);//寄存器地址 |
| | | staProtocol.setStaNo(newSingle);//修改PLC寄存器地址值,8==>0 |
| | | return MessageQueue.offer(devp, id, new Task(3, staProtocol)); |
| | | } |
| | | |
| | | public boolean messageQueueOffer2(int i ,short newSingle,SlaveType devp,Integer id){ |
| | | //复位PLC信号,借用输送站点实体类 |
| | | StaProtocol staProtocol = new StaProtocol(); |
| | | staProtocol.setSiteId(i*2);//寄存器地址 |
| | | staProtocol.setStaNo(newSingle);//修改PLC寄存器地址值,8==>0 |
| | | return MessageQueue.offer(devp, id, new Task(5, staProtocol)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 103站点有物下发pack码 |
| | | */ |
| | | @Transactional |
| | | public void packDevp() { |
| | | try { |
| | | // 根据输送线plc遍历 |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("bas_devp",103)); |
| | | if (Cools.isEmpty(basDevp)){ |
| | | log.error("103站点查询失败-MainServiceImpl.java-2255行"); |
| | | } |
| | | if (basDevp.getAutoing().equals("Y") && basDevp.getWrkNo()>0 && basDevp.getLoading().equals("Y") ){ |
| | | WrkDetl wrkDetl = wrkDetlService.devpPackNo(basDevp.getWrkNo()); |
| | | if (Cools.isEmpty(wrkDetl)){ |
| | | log.error("103站点查询失败-MainServiceImpl.java-2255行"); |
| | | } |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(4,wrkDetl.getMatnr())); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("103 ===>> 给输送线发送Pack码失败", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | } |