Class ControllerIoHeatPumpSgReadyImpl
java.lang.Object
io.openems.edge.common.component.AbstractOpenemsComponent
io.openems.edge.controller.io.heatpump.sgready.ControllerIoHeatPumpSgReadyImpl
- All Implemented Interfaces:
OpenemsComponent
,Controller
,ControllerIoHeatPumpSgReady
,TimedataProvider
,org.osgi.service.event.EventHandler
public class ControllerIoHeatPumpSgReadyImpl
extends AbstractOpenemsComponent
implements Controller, OpenemsComponent, ControllerIoHeatPumpSgReady, org.osgi.service.event.EventHandler, 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.heatpump.sgready.ControllerIoHeatPumpSgReady
ControllerIoHeatPumpSgReady.ChannelId
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
changeState
(Status status) Change of a state.protected void
Handles @Deactivate of implementations.Gets theTimedata
service.void
handleEvent
(org.osgi.service.event.Event event) protected void
Log a debug message including the Component ID.void
run()
Executes the Controller logic.protected void
setOutput
(ChannelAddress channelAddress, boolean value) Switch an output if it was not switched before.protected void
setOutputs
(boolean output1, boolean output2) Helper method to set the two booleans for the two outputs.Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, activate, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, 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.controller.io.heatpump.sgready.ControllerIoHeatPumpSgReady
_setAwaitingHysteresis, _setEssDischargePowerNotPresent, _setGridActivePowerNotPresent, _setStateOfChargeNotPresent, _setStatus, getAwaitingHysteresis, getAwaitingHysteresisChannel, getEssDischargePowerNotPresent, getEssDischargePowerNotPresentChannel, getGridActivePowerNotPresent, getGridActivePowerNotPresentChannel, getStateOfChargeNotPresent, getStateOfChargeNotPresentChannel, getStatus, getStatusChannel
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
-
Field Details
-
sum
-
activeState
-
lastStateChange
-
-
Constructor Details
-
ControllerIoHeatPumpSgReadyImpl
public ControllerIoHeatPumpSgReadyImpl()
-
-
Method Details
-
deactivate
protected void deactivate()Description copied from class:AbstractOpenemsComponent
Handles @Deactivate of implementations. Prints log output.- Overrides:
deactivate
in classAbstractOpenemsComponent
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
-
run
Description copied from interface:Controller
Executes the Controller logic.- Specified by:
run
in interfaceController
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
setOutputs
protected void setOutputs(boolean output1, boolean output2) throws IllegalArgumentException, OpenemsError.OpenemsNamedException Helper method to set the two booleans for the two outputs.- Parameters:
output1
- Value that should be set on output 1.output2
- Value that should be set on output 2.- Throws:
IllegalArgumentException
- on errorOpenemsError.OpenemsNamedException
- on error
-
setOutput
protected void setOutput(ChannelAddress channelAddress, boolean value) throws IllegalArgumentException, OpenemsError.OpenemsNamedException Switch an output if it was not switched before.- Parameters:
channelAddress
- The address of the channel.value
- Boolean that should be set on the output.- Throws:
IllegalArgumentException
- on errorOpenemsError.OpenemsNamedException
- on error
-
logDebug
Description copied from class:AbstractOpenemsComponent
Log a debug message including the Component ID.- Overrides:
logDebug
in classAbstractOpenemsComponent
- Parameters:
log
- the Logger instancemessage
- the message
-
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.
-
changeState
public void changeState(Status status) throws IllegalArgumentException, OpenemsError.OpenemsNamedException Change of a state.Sets the digital outputs, the currently active status and the lastStateChange time set point.
- Parameters:
status
- New active status- Throws:
OpenemsError.OpenemsNamedException
- on errorIllegalArgumentException
- on error
-