| | |
| | | private void taskIssued() { |
| | | while (true) { |
| | | try { |
| | | if(!connectSte){ |
| | | try { |
| | | Thread.sleep(1000L); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | continue; |
| | | } |
| | | int step = 1; |
| | | Task task = MessageQueue.poll(SlaveType.Ste, slave.getId()); |
| | | if (task != null) { |
| | |
| | | private void readStatusSte() { |
| | | while (true) { |
| | | try { |
| | | if(!connectSte){ |
| | | try { |
| | | Thread.sleep(1000L); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | initSte(); |
| | | continue; |
| | | } |
| | | Thread.sleep(50); |
| | | // System.out.println("读线程"+ slave.getId()); |
| | | |
| | |
| | | BasSteService service = SpringUtils.getBean(BasSteService.class); |
| | | if (null != service) { |
| | | // 同步pakMk |
| | | BasSte one = service.selectById(slave.getId()); |
| | | BasSte one = service.getById(slave.getId()); |
| | | if (one != null) { |
| | | steProtocol.setPakMk(one.getPakMk()); |
| | | } |
| | |
| | | null, // 修改人员 |
| | | null // 备注 |
| | | ); |
| | | bean.insert(basSteOpt); |
| | | bean.save(basSteOpt); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | public boolean confirmPos() { |
| | | BasSteService service = SpringUtils.getBean(BasSteService.class); |
| | | BasSte basSte = service.selectById(slave.getId()); |
| | | BasSte basSte = service.getById(slave.getId()); |
| | | if (basSte != null) { |
| | | // 更新plc数据块 |
| | | short[] arr = new short[] {basSte.getRow().shortValue(), basSte.getBay().shortValue(), basSte.getLev().shortValue()}; |