public class HeatPumpImpl extends AbstractOpenemsComponent implements Controller, OpenemsComponent, HeatPump, org.osgi.service.event.EventHandler, TimedataProvider, ComponentManagerProvider
Controller.ChannelId
HeatPump.ChannelId
Modifier and Type | Field and Description |
---|---|
protected Status |
activeState |
protected ComponentManager |
componentManager |
protected java.time.Instant |
lastStateChange |
protected Sum |
sum |
Constructor and Description |
---|
HeatPumpImpl() |
Modifier and Type | Method and Description |
---|---|
void |
changeState(Status status)
Change of a state.
|
protected void |
deactivate()
Handles @Deactivate of implementations.
|
ComponentManager |
getComponentManager()
Gets the
ComponentManager service. |
Timedata |
getTimedata()
Gets the
Timedata 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.
|
_channel, activate, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logError, logInfo, logWarn, modified, removeChannel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
_setRunFailed, getModbusSlaveNatureTable, getRunFailed, getRunFailedChannel
_setAwaitingHysteresis, _setEssDischargePowerNotPresent, _setGridActivePowerNotPresent, _setStateOfChargeNotPresent, _setStatus, getAwaitingHysteresis, getAwaitingHysteresisChannel, getEssDischargePowerNotPresent, getEssDischargePowerNotPresentChannel, getGridActivePowerNotPresent, getGridActivePowerNotPresentChannel, getStateOfChargeNotPresent, getStateOfChargeNotPresentChannel, getStatus, getStatusChannel
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid, updateConfigurationProperty, updateReferenceFilter
protected Status activeState
protected java.time.Instant lastStateChange
protected Sum sum
protected ComponentManager componentManager
protected void deactivate()
AbstractOpenemsComponent
deactivate
in class AbstractOpenemsComponent
public void handleEvent(org.osgi.service.event.Event event)
handleEvent
in interface org.osgi.service.event.EventHandler
public void run() throws OpenemsError.OpenemsNamedException
Controller
run
in interface Controller
OpenemsError.OpenemsNamedException
- on errorprotected void setOutputs(boolean output1, boolean output2) throws java.lang.IllegalArgumentException, OpenemsError.OpenemsNamedException
output1
- Value that should be set on output 1.output2
- Value that should be set on output 2.java.lang.IllegalArgumentException
- on errorOpenemsError.OpenemsNamedException
- on errorprotected void setOutput(ChannelAddress channelAddress, boolean value) throws java.lang.IllegalArgumentException, OpenemsError.OpenemsNamedException
channelAddress
- The address of the channel.value
- Boolean that should be set on the output.java.lang.IllegalArgumentException
- on errorOpenemsError.OpenemsNamedException
- on errorprotected void logDebug(org.slf4j.Logger log, java.lang.String message)
AbstractOpenemsComponent
logDebug
in class AbstractOpenemsComponent
log
- the Logger instancemessage
- the messagepublic ComponentManager getComponentManager()
ComponentManagerProvider
ComponentManager
service.getComponentManager
in interface ComponentManagerProvider
public Timedata getTimedata()
TimedataProvider
Timedata
service.getTimedata
in interface TimedataProvider
public void changeState(Status status) throws java.lang.IllegalArgumentException, OpenemsError.OpenemsNamedException
Sets the digital outputs, the currently active status and the lastStateChange time set point.
status
- New active statusOpenemsError.OpenemsNamedException
- on errorjava.lang.IllegalArgumentException
- on error