Class TimedataManagerImpl
java.lang.Object
io.openems.backend.common.component.AbstractOpenemsBackendComponent
io.openems.backend.core.timedatamanager.TimedataManagerImpl
- All Implemented Interfaces:
TimedataManager
,CommonTimedataService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addTimedata
(Timedata timedata) SortedMap<ZonedDateTime,
SortedMap<ChannelAddress, com.google.gson.JsonElement>> queryHistoricData
(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) Queries historic data.SortedMap<ChannelAddress,
com.google.gson.JsonElement> queryHistoricEnergy
(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels) Queries historic energy.SortedMap<ZonedDateTime,
SortedMap<ChannelAddress, com.google.gson.JsonElement>> queryHistoricEnergyPerPeriod
(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) Queries historic energy per period.protected void
removeTimedata
(Timedata timedata) void
write
(String edgeId, com.google.common.collect.TreeBasedTable<Long, String, com.google.gson.JsonElement> data) Sends the data points to the Timedata services.Methods inherited from class io.openems.backend.common.component.AbstractOpenemsBackendComponent
getName, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarn, logWarn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.openems.common.timedata.CommonTimedataService
handleQueryHistoricTimeseriesExportXlxsRequest, queryHistoricData
-
Constructor Details
-
TimedataManagerImpl
public TimedataManagerImpl(io.openems.backend.core.timedatamanager.Config config)
-
-
Method Details
-
addTimedata
-
removeTimedata
-
queryHistoricData
public SortedMap<ZonedDateTime,SortedMap<ChannelAddress, queryHistoricDatacom.google.gson.JsonElement>> (String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) throws OpenemsError.OpenemsNamedException Description copied from interface:CommonTimedataService
Queries historic data.- Specified by:
queryHistoricData
in interfaceCommonTimedataService
- Parameters:
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the Channelsresolution
- theResolution
- Returns:
- the query result
- Throws:
OpenemsError.OpenemsNamedException
-
queryHistoricEnergy
public SortedMap<ChannelAddress,com.google.gson.JsonElement> queryHistoricEnergy(String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels) throws OpenemsError.OpenemsNamedException Description copied from interface:CommonTimedataService
Queries historic energy.- Specified by:
queryHistoricEnergy
in interfaceCommonTimedataService
- Parameters:
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the Channels- Returns:
- the query result
- Throws:
OpenemsError.OpenemsNamedException
-
queryHistoricEnergyPerPeriod
public SortedMap<ZonedDateTime,SortedMap<ChannelAddress, queryHistoricEnergyPerPeriodcom.google.gson.JsonElement>> (String edgeId, ZonedDateTime fromDate, ZonedDateTime toDate, Set<ChannelAddress> channels, Resolution resolution) throws OpenemsError.OpenemsNamedException Description copied from interface:CommonTimedataService
Queries historic energy per period.This is for use-cases where you want to get the energy for each period (with
Resolution
) per Channel, e.g. to visualize energy in a histogram chart. For each period the energy is calculated by subtracting first value of the period from the last value of the period.- Specified by:
queryHistoricEnergyPerPeriod
in interfaceCommonTimedataService
- Parameters:
edgeId
- the Edge-ID; or null query allfromDate
- the From-DatetoDate
- the To-Datechannels
- the Channelsresolution
- theResolution
- Returns:
- the query result
- Throws:
OpenemsError.OpenemsNamedException
-
write
public void write(String edgeId, com.google.common.collect.TreeBasedTable<Long, String, com.google.gson.JsonElement> data) Description copied from interface:TimedataManager
Sends the data points to the Timedata services.- Specified by:
write
in interfaceTimedataManager
- Parameters:
edgeId
- The unique Edge-IDdata
- Table of timestamp (epoch in milliseconds), Channel-Address and the Channel value as JsonElement. Sorted by timestamp.
-