Class HeatPumpImpl
- java.lang.Object
-
- io.openems.edge.common.component.AbstractOpenemsComponent
-
- io.openems.edge.controller.io.heatpump.sgready.HeatPumpImpl
-
- All Implemented Interfaces:
OpenemsComponent
,Controller
,HeatPump
,TimedataProvider
,org.osgi.service.event.EventHandler
public class HeatPumpImpl extends AbstractOpenemsComponent implements Controller, OpenemsComponent, HeatPump, 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.HeatPump
HeatPump.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
-
Field Summary
Fields Modifier and Type Field Description protected Status
activeState
protected ComponentManager
componentManager
protected java.time.Instant
lastStateChange
protected Sum
sum
-
Constructor Summary
Constructors Constructor Description HeatPumpImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeState(Status status)
Change of a state.protected void
deactivate()
Handles @Deactivate of implementations.Timedata
getTimedata()
Gets theTimedata
service.void
handleEvent(org.osgi.service.event.Event event)
protected void
logDebug(org.slf4j.Logger log, java.lang.String message)
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.HeatPump
_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 Detail
-
activeState
protected Status activeState
-
lastStateChange
protected java.time.Instant lastStateChange
-
sum
protected Sum sum
-
componentManager
protected ComponentManager componentManager
-
-
Method Detail
-
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
public void run() throws OpenemsError.OpenemsNamedException
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 java.lang.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:
java.lang.IllegalArgumentException
- on errorOpenemsError.OpenemsNamedException
- on error
-
setOutput
protected void setOutput(ChannelAddress channelAddress, boolean value) throws java.lang.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:
java.lang.IllegalArgumentException
- on errorOpenemsError.OpenemsNamedException
- on error
-
logDebug
protected void logDebug(org.slf4j.Logger log, java.lang.String message)
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
public Timedata 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 java.lang.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 errorjava.lang.IllegalArgumentException
- on error
-
-