Пример #1
0
  @Override
  public void terminate() {
    terminateIntervalLogging();

    if (detectors != null) {
      for (PointEventDetectorRT pedRT : detectors) {
        Common.runtimeManager.removeDataPointListener(vo.getId(), pedRT);
        pedRT.terminate();
      }
    }
    Common.eventManager.cancelEventsForDataPoint(vo.getId());
  }
Пример #2
0
  //
  //
  // Lifecycle
  //
  @Override
  public void initialize() {
    // Get the latest value for the point from the database.
    pointValue = valueCache.getLatestPointValue();

    // Set the tolerance origin if this is a numeric
    if (pointValue != null && pointValue.getValue() instanceof NumericValue)
      toleranceOrigin = pointValue.getDoubleValue();

    // Add point event listeners
    for (PointEventDetectorVO ped : vo.getEventDetectors()) {
      if (detectors == null) detectors = new ArrayList<PointEventDetectorRT>();

      PointEventDetectorRT pedRT = ped.createRuntime();
      detectors.add(pedRT);
      pedRT.initialize();
      Common.runtimeManager.addDataPointListener(vo.getId(), pedRT);
    }

    initializeIntervalLogging();
  }