Package io.openems.edge.timedata.rrd4j
Class RecordWorker
java.lang.Object
io.openems.common.worker.AbstractWorker
io.openems.common.worker.AbstractImmediateWorker
io.openems.edge.timedata.rrd4j.RecordWorker
-
Nested Class Summary
-
Field Summary
Fields inherited from class io.openems.common.worker.AbstractWorker
ALWAYS_WAIT_FOR_TRIGGER_NEXT_RUN, DO_NOT_WAIT, thread
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static com.google.gson.JsonElement
aggregateEnumChannel
(Channel<?> channel, LocalDateTime channelStartTime, LocalDateTime endTime) void
Collects the data from Channels.void
Stops the worker thread.protected void
forever()
This method is called in a loop forever until the Thread gets interrupted.void
setConfig
(RecordWorker.Config config) Methods inherited from class io.openems.common.worker.AbstractImmediateWorker
activate, getCycleTime
Methods inherited from class io.openems.common.worker.AbstractWorker
activate, modified, modified, setPriority, triggerNextRun
-
Constructor Details
-
RecordWorker
public RecordWorker()
-
-
Method Details
-
setConfig
-
deactivate
public void deactivate()Description copied from class:AbstractWorker
Stops the worker thread.- Overrides:
deactivate
in classAbstractImmediateWorker
-
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
Description copied from class:AbstractWorker
This method is called in a loop forever until the Thread gets interrupted.- Specified by:
forever
in classAbstractImmediateWorker
- Throws:
InterruptedException
-
aggregateEnumChannel
protected static com.google.gson.JsonElement aggregateEnumChannel(Channel<?> channel, LocalDateTime channelStartTime, LocalDateTime endTime)
-