Package io.openems.edge.ess.core.power
Class EssPowerImpl
java.lang.Object
io.openems.edge.common.component.AbstractOpenemsComponent
io.openems.edge.ess.core.power.EssPowerImpl
- All Implemented Interfaces:
OpenemsComponent
,EssPower
,Power
,org.osgi.service.event.EventHandler
public class EssPowerImpl
extends AbstractOpenemsComponent
implements EssPower, OpenemsComponent, org.osgi.service.event.EventHandler, Power
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.openems.edge.ess.core.power.EssPower
EssPower.ChannelId
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
Field Summary
Fields inherited from interface io.openems.edge.ess.core.power.EssPower
DEFAULT_DEBUG_MODE, DEFAULT_SOLVER_STRATEGY, DEFAULT_SYMMETRIC_MODE, SINGLETON_COMPONENT_ID, SINGLETON_SERVICE_PID
Fields inherited from interface io.openems.edge.ess.power.api.Power
NO_CONSTRAINTS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddConstraint
(Constraint constraint) Adds a Constraint.addConstraintAndValidate
(Constraint constraint) Adds a Constraint if the problem is still solvable afterwards.protected void
createSimpleConstraint
(String description, ManagedSymmetricEss ess, Phase phase, Pwr pwr, Relationship relationship, double value) Creates a simple constraint.protected void
Handles @Deactivate of implementations.getCoefficient
(ManagedSymmetricEss ess, Phase phase, Pwr pwr) Gets the Coefficient singleton for a specific combination of ess, phase and pwr.protected ManagedSymmetricEss
Gets the Ess component with the given ID.int
getMaxPower
(ManagedSymmetricEss ess, Phase phase, Pwr pwr) Gets the maximum possible Power under the active Constraints.int
getMinPower
(ManagedSymmetricEss ess, Phase phase, Pwr pwr) Gets the minimum possible possible Power under the active Constraints.Gets the PidFilter instance with the configured P, I and D variables.void
handleEvent
(org.osgi.service.event.Event event) boolean
Is Debug-Mode activated?.boolean
Check if PidFilter is enabled.protected void
Log an error message including the Component ID.void
removeConstraint
(Constraint constraint) Removes a Constraint.protected void
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, activate, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logDebug, 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.ess.core.power.EssPower
_setNotSolved, _setSolveDuration, _setSolveStrategy, _setStaticConstraintsFailed, getNotSolvedChannel, getSolveDurationChannel, getSolveStrategyChannel, getStaticConstraintsFailedChannel
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
Methods inherited from interface io.openems.edge.ess.power.api.Power
fitValueIntoMinMaxPower, fitValueToMaxPower, fitValueToMinPower
-
Constructor Details
-
EssPowerImpl
public EssPowerImpl()
-
-
Method Details
-
deactivate
protected void deactivate()Description copied from class:AbstractOpenemsComponent
Handles @Deactivate of implementations. Prints log output.- Overrides:
deactivate
in classAbstractOpenemsComponent
-
addEss
-
removeEss
-
addConstraint
Description copied from interface:Power
Adds a Constraint.- Specified by:
addConstraint
in interfacePower
- Parameters:
constraint
- theConstraint
- Returns:
- the
Constraint
-
addConstraintAndValidate
Description copied from interface:Power
Adds a Constraint if the problem is still solvable afterwards.- Specified by:
addConstraintAndValidate
in interfacePower
- Parameters:
constraint
- theConstraint
- Returns:
- the
Constraint
- Throws:
OpenemsException
- on error
-
getCoefficient
public Coefficient getCoefficient(ManagedSymmetricEss ess, Phase phase, Pwr pwr) throws OpenemsException Description copied from interface:Power
Gets the Coefficient singleton for a specific combination of ess, phase and pwr.- Specified by:
getCoefficient
in interfacePower
- Parameters:
ess
- theManagedSymmetricEss
phase
- thePhase
pwr
- thePwr
- Returns:
- the
Coefficient
- Throws:
OpenemsException
- on error
-
createSimpleConstraint
public Constraint createSimpleConstraint(String description, ManagedSymmetricEss ess, Phase phase, Pwr pwr, Relationship relationship, double value) throws OpenemsException Description copied from interface:Power
Creates a simple constraint.- Specified by:
createSimpleConstraint
in interfacePower
- Parameters:
description
- a description (for debug)ess
- theManagedSymmetricEss
phase
- thePhase
pwr
- thePwr
relationship
- theRelationship
value
- the value- Returns:
- the
Constraint
- Throws:
OpenemsException
- on error
-
removeConstraint
Description copied from interface:Power
Removes a Constraint.- Specified by:
removeConstraint
in interfacePower
- Parameters:
constraint
- theConstraint
-
getMaxPower
Description copied from interface:Power
Gets the maximum possible Power under the active Constraints.- Specified by:
getMaxPower
in interfacePower
- Parameters:
ess
- theManagedSymmetricEss
phase
- thePhase
pwr
- thePwr
- Returns:
- the maximum possible power
-
getMinPower
Description copied from interface:Power
Gets the minimum possible possible Power under the active Constraints.- Specified by:
getMinPower
in interfacePower
- Parameters:
ess
- theManagedSymmetricEss
phase
- thePhase
pwr
- thePwr
- Returns:
- the minimum possible power
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
-
getEss
Gets the Ess component with the given ID.- Parameters:
essId
- the component ID of Ess- Returns:
- an Ess instance
-
logError
Description copied from class:AbstractOpenemsComponent
Log an error message including the Component ID.- Overrides:
logError
in classAbstractOpenemsComponent
- Parameters:
log
- the Logger instancemessage
- the message
-
getPidFilter
Description copied from interface:Power
Gets the PidFilter instance with the configured P, I and D variables.- Specified by:
getPidFilter
in interfacePower
- Returns:
- an instance of
PidFilter
-
isDebugMode
public boolean isDebugMode()Is Debug-Mode activated?.- Returns:
- true if is activated
-
isPidEnabled
public boolean isPidEnabled()Description copied from interface:Power
Check if PidFilter is enabled.- Specified by:
isPidEnabled
in interfacePower
- Returns:
- true if PidFilter is enable, otherwise false
-