public void changeDataEngineStatus() { if (dataEngineStatus == true) { engine.run(); } else { engine.stopEngine(); } }
@PostConstruct private void init() { initNativeLib(); engine = new Engine(); engine.configure(); initDevices(); System.out.println(allDevices); }
private synchronized void updateValues() { for (TagBlankEntity tagBlankEntity : deviceEntity.getTagBlankEntities()) { Value value = new Value( Engine.getInstance() .getHardwareEngine() .getRegisterByID(tagBlankEntity.getTagBinding()), tagBlankEntity); values.put(tagBlankEntity.getTagDescr(), value); } }
private void initDevices() { allDevices.clear(); for (ProtocolMaster master : engine.getProtocolMasterMap().values()) { for (ProtocolSlave slave : master.getSlaves().values()) { if (allDevices.containsKey(slave.getDevice())) { WebDevice webDevice = allDevices.get(slave.getDevice()); webDevice.addChannel(slave); } else { WebDevice webDevice = new WebDevice(slave.getDevice()); webDevice.addChannel(slave); allDevices.put(slave.getDevice(), webDevice); } } } }