| | |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (Cools.isEmpty(steProtocol.loca)) continue; |
| | | if (steProtocol.loca==0) continue; |
| | | if (Utils.getGroupRow(locNo).equals(Utils.getGroupRow(steProtocol.getRow().intValue())) && steProtocol.getBay() == Utils.getBay(locNo) && steProtocol.getLev() == Utils.getLev(locNo)) { |
| | | return steProtocol.getSteNo().intValue(); |
| | |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, ste.getId()); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (Cools.isEmpty(steProtocol.loca)) continue; |
| | | if (steProtocol.loca==0) continue; |
| | | if (steProtocol.isIdle()) { |
| | | if (Utils.getGroupRow(locNo).equals(Utils.getGroupRow(steProtocol.getRow().intValue())) && steProtocol.getBay() == Utils.getBay(locNo) && steProtocol.getLev() == Utils.getLev(locNo)) { |
| | |
| | | */ |
| | | public synchronized void ledExecute() { |
| | | for (LedSlave led : slaveProperties.getLed()) { |
| | | try{ |
| | | // 获取输送线plc线程 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId()); |
| | | // 命令集合 |
| | |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) { |
| | | News.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | continue; |
| | | } else { |
| | | News.info("{}号LED命令下发成功!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | News.info("{}号LED命令下发成功!!![commands:{}]", led.getId(), commands); |
| | | } |
| | | } |
| | | |
| | |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } catch (Exception e){ |
| | | News.error(e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | */ |
| | | public synchronized void ledReset() { |
| | | for (LedSlave led : slaveProperties.getLed()) { |
| | | try{ |
| | | // 获取输送线plc线程 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId()); |
| | | // 命令集合 |
| | |
| | | // led显示默认内容 |
| | | if (reset) { |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) { |
| | | News.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | News.error("{}号LED复位命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | } else { |
| | | News.info("{}号LED复位命令下发成功!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | News.error("LED异常"+led.getId()); |
| | | } |
| | | } |
| | | } |
| | | |