Class ControllerIoAnalogImpl
java.lang.Object
io.openems.edge.common.component.AbstractOpenemsComponent
io.openems.edge.controller.io.analog.ControllerIoAnalogImpl
- All Implemented Interfaces:
OpenemsComponent
,Controller
,ControllerIoAnalog
,TimedataProvider
public class ControllerIoAnalogImpl
extends AbstractOpenemsComponent
implements ControllerIoAnalog, Controller, OpenemsComponent, TimedataProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.openems.edge.controller.api.Controller
Controller.ChannelId
Nested classes/interfaces inherited from interface io.openems.edge.controller.io.analog.ControllerIoAnalog
ControllerIoAnalog.ChannelId
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static float
calculateSetPointFromPower
(int maximumPower, int targetPower, PowerBehavior powerBehavior) Calculate the set point depending on the current settings.protected static int
calculateUsedPower
(int maximumPower, float currentOutputPercent, PowerBehavior powerBehavior) Calculate the current power depending on the current settings.protected void
Handles @Deactivate of implementations.Gets theTimedata
service.void
run()
Executes the Controller logic.Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, activate, addChannel, addChannels, addChannels, alias, channels, 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.controller.api.Controller
_setRunFailed, getRunFailed, getRunFailedChannel
Methods inherited from interface io.openems.edge.common.component.OpenemsComponent
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid
-
Constructor Details
-
ControllerIoAnalogImpl
public ControllerIoAnalogImpl() -
ControllerIoAnalogImpl
-
-
Method Details
-
deactivate
protected void deactivate()Description copied from class:AbstractOpenemsComponent
Handles @Deactivate of implementations. Prints log output.- Overrides:
deactivate
in classAbstractOpenemsComponent
-
run
Description copied from interface:Controller
Executes the Controller logic.- Specified by:
run
in interfaceController
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
calculateUsedPower
protected static int calculateUsedPower(int maximumPower, float currentOutputPercent, PowerBehavior powerBehavior) Calculate the current power depending on the current settings.Attention: Even if the "Power Behaviour" is defining the hardware behavior, the real consumption depends on the device itself and we have to assume that the unit behaves in a similar way. For the exact values, a separate meter would be needed.
- Parameters:
maximumPower
- maximum power of the devicecurrentOutputPercent
- current output in %powerBehavior
- the power behavior asPowerBehavior
- Returns:
- power used by the device
-
calculateSetPointFromPower
protected static float calculateSetPointFromPower(int maximumPower, int targetPower, PowerBehavior powerBehavior) Calculate the set point depending on the current settings.Attention: Even if the "Power Behaviour" is defining the hardware behavior, the real consumption depends on the device itself and we have to assume that the unit behaves in a similar way and is using the calculated power.
- Parameters:
maximumPower
- maximum power of the devicetargetPower
- target powerpowerBehavior
- power behavior- Returns:
- current set point in %
-
getTimedata
Description copied from interface:TimedataProvider
Gets theTimedata
service.- Specified by:
getTimedata
in interfaceTimedataProvider
- Returns:
- the service or null if it is not (yet) available.
-