Package io.openems.edge.app.common.props
Class RelayProps
java.lang.Object
io.openems.edge.app.common.props.RelayProps
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
static final record
static interface
Provider interface for aRelayProps.RelayContactInformation
. -
Method Summary
Modifier and TypeMethodDescriptioncreatePhaseInformation
(ComponentUtil util, int numberOfRelays, List<RelayProps.RelayContactFilter> filter, List<ComponentUtil.PreferredRelay> preferredRelays) Utility method to create aRelayProps.RelayContactInformation
.Creates an emptyRelayProps.RelayContactFilter
.static ComponentUtil.PreferredRelay
feneconHome2030PreferredRelays
(boolean isHomeInstalled, int[] preferredRelays) Creates theComponentUtil.PreferredRelay
if a Home 20/30 relay board is installed.feneconHomeFilter
(Language l, boolean isHomeInstalled, boolean onlyHighVoltageRelays) Creates aRelayProps.RelayContactFilter
for a home.static <APP extends OpenemsApp,
PROP extends Nameable & Type<PROP, APP, P>, P extends Type.Parameter.BundleProvider>
AppDef<APP, PROP, P> phaseGroup
(PROP... phaseDefs) Creates aAppDef
for a group of picking contacts from relays.static <P extends Type.Parameter.BundleProvider & RelayProps.RelayContactInformationProvider>
AppDef<OpenemsApp, Nameable, P> relayContactDef
(boolean isMulti, int contactPosition, Nameable... allContacts) Creates aAppDef
for selecting a relay contact.static <P extends Type.Parameter.BundleProvider & RelayProps.RelayContactInformationProvider>
AppDef<OpenemsApp, Nameable, P> relayContactDef
(int contactPosition, Nameable... allContacts) Creates aAppDef
for selecting a relay contact.
-
Method Details
-
createPhaseInformation
public static RelayProps.RelayContactInformation createPhaseInformation(ComponentUtil util, int numberOfRelays, List<RelayProps.RelayContactFilter> filter, List<ComponentUtil.PreferredRelay> preferredRelays) Utility method to create aRelayProps.RelayContactInformation
.- Parameters:
util
- theComponentUtil
numberOfRelays
- the number of relaysfilter
- theRelayProps.RelayContactFilter
preferredRelays
- thePreferredRelays
- Returns:
- the created
RelayProps.RelayContactInformation
- See Also:
-
emptyFilter
Creates an emptyRelayProps.RelayContactFilter
.- Returns:
- the
RelayProps.RelayContactFilter
-
feneconHomeFilter
public static RelayProps.RelayContactFilter feneconHomeFilter(Language l, boolean isHomeInstalled, boolean onlyHighVoltageRelays) Creates aRelayProps.RelayContactFilter
for a home.- Parameters:
l
- the current languageisHomeInstalled
- if a home is installed; can be obtained withPropsUtil.isHomeInstalled(io.openems.edge.core.appmanager.AppManagerUtil)
onlyHighVoltageRelays
- determines which relay channels are disabled- Returns:
- the
RelayProps.RelayContactFilter
-
feneconHome2030PreferredRelays
public static ComponentUtil.PreferredRelay feneconHome2030PreferredRelays(boolean isHomeInstalled, int[] preferredRelays) Creates theComponentUtil.PreferredRelay
if a Home 20/30 relay board is installed.- Parameters:
isHomeInstalled
- if a Home is installedpreferredRelays
- the relay contacts- Returns:
- the
ComponentUtil.PreferredRelay
configuration
-
relayContactDef
public static <P extends Type.Parameter.BundleProvider & RelayProps.RelayContactInformationProvider> AppDef<OpenemsApp,Nameable, relayContactDefP> (int contactPosition, Nameable... allContacts) Creates aAppDef
for selecting a relay contact. Sets the default value from theRelayProps.RelayContactInformation
and also disables options which are already used by other components.- Type Parameters:
P
- the type of the parameter- Parameters:
contactPosition
- the number of the contacts to select e. g. a HeatPump app needs 2 relay contacts to be configured pass 1 for the first and 2 for the second one.allContacts
- the other names of contacts- Returns:
- the
AppDef
-
relayContactDef
public static <P extends Type.Parameter.BundleProvider & RelayProps.RelayContactInformationProvider> AppDef<OpenemsApp,Nameable, relayContactDefP> (boolean isMulti, int contactPosition, Nameable... allContacts) Creates aAppDef
for selecting a relay contact. Sets the default value from theRelayProps.RelayContactInformation
and also disables options which are already used by other components.- Type Parameters:
P
- the type of the parameter- Parameters:
isMulti
- if the selection is an array of channelcontactPosition
- the number of the contacts to select e. g. a HeatPump app needs 2 relay contacts to be configured pass 1 for the first and 2 for the second one.allContacts
- the other names of contacts- Returns:
- the
AppDef
-
phaseGroup
@SafeVarargs public static <APP extends OpenemsApp,PROP extends Nameable & Type<PROP, AppDef<APP,APP, P>, P extends Type.Parameter.BundleProvider> PROP, phaseGroupP> (PROP... phaseDefs) Creates aAppDef
for a group of picking contacts from relays. Used to not pick contacts twice.
-