Class RecordWorker

public class RecordWorker extends AbstractImmediateWorker
  • Constructor Details

    • RecordWorker

      public RecordWorker()
  • Method Details

    • setConfig

      public void setConfig(RecordWorker.Config config)
    • deactivate

      public void deactivate()
      Description copied from class: AbstractWorker
      Stops the worker thread.
      deactivate in class AbstractImmediateWorker
    • collectData

      public void collectData()
      Collects the data from Channels. This is called synchronously by the main OpenEMS cycle. On finish it triggers a next async task to write the data to RRD4J.

      Cumulated Channels are collected with a timestamp rounded to the current hour. e.g.

       08:00     08:35 09:00
       08:00 -> timestamp of the data
       08:35 -> timestamp the data gets collected
    • forever

      protected void forever() throws InterruptedException
      Description copied from class: AbstractWorker
      This method is called in a loop forever until the Thread gets interrupted.
      Specified by:
      forever in class AbstractImmediateWorker
    • aggregateEnumChannel

      protected static aggregateEnumChannel(Channel<?> channel, LocalDateTime channelStartTime, LocalDateTime endTime)