示例#1
0
 public void changeDataEngineStatus() {
   if (dataEngineStatus == true) {
     engine.run();
   } else {
     engine.stopEngine();
   }
 }
示例#2
0
  @PostConstruct
  private void init() {
    initNativeLib();
    engine = new Engine();
    engine.configure();

    initDevices();

    System.out.println(allDevices);
  }
示例#3
0
 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);
   }
 }
示例#4
0
 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);
       }
     }
   }
 }