Class AbstractCsvDatasource
java.lang.Object
io.openems.edge.common.component.AbstractOpenemsComponent
io.openems.edge.simulator.datasource.api.AbstractCsvDatasource
- All Implemented Interfaces:
OpenemsComponent
,SimulatorDatasource
,org.osgi.service.event.EventHandler
- Direct Known Subclasses:
SimulatorDatasourceCsvDirectImpl
,SimulatorDatasourceCsvPredefinedImpl
,SimulatorDatasourceSingleDirectImpl
public abstract class AbstractCsvDatasource
extends AbstractOpenemsComponent
implements SimulatorDatasource, org.osgi.service.event.EventHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractCsvDatasource
(ChannelId[] firstInitialChannelIds, ChannelId[]... furtherInitialChannelIds) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
activate
(org.osgi.service.component.ComponentContext context, String id, String alias, boolean enabled, int timeDelta) protected abstract ComponentManager
protected abstract DataContainer
getData()
getKeys()
Gets the available keys.int
Returns the delta between two values in seconds.<T> T
getValue
(OpenemsType type, ChannelAddress channelAddress) Gets the value for the given key (channelId) in the given type.void
handleEvent
(org.osgi.service.event.Event event) Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, activate, addChannel, addChannels, addChannels, alias, channels, deactivate, getComponentContext, id, isEnabled, logDebug, logError, logInfo, logWarn, modified, removeChannel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.openems.edge.common.component.OpenemsComponent
_getChannelAs, channel, channel, debugLog, getState, getStateChannel, hasFaults, serviceFactoryPid, servicePid
-
Constructor Details
-
AbstractCsvDatasource
-
-
Method Details
-
getComponentManager
-
getData
- Throws:
NumberFormatException
IOException
-
activate
protected void activate(org.osgi.service.component.ComponentContext context, String id, String alias, boolean enabled, int timeDelta) throws NumberFormatException, IOException - Throws:
NumberFormatException
IOException
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
-
getValue
Description copied from interface:SimulatorDatasource
Gets the value for the given key (channelId) in the given type.- Specified by:
getValue
in interfaceSimulatorDatasource
- Type Parameters:
T
- the type- Parameters:
type
- the expected typechannelAddress
- the Channel-Address- Returns:
- the value, possibly null
-
getKeys
Description copied from interface:SimulatorDatasource
Gets the available keys.- Specified by:
getKeys
in interfaceSimulatorDatasource
- Returns:
- the Channel-Id
-
getTimeDelta
public int getTimeDelta()Description copied from interface:SimulatorDatasource
Returns the delta between two values in seconds.- Specified by:
getTimeDelta
in interfaceSimulatorDatasource
- Returns:
- the delta in seconds
-