Package io.openems.edge.common.channel
Class EnumWriteChannel
java.lang.Object
io.openems.edge.common.channel.internal.AbstractReadChannel<EnumDoc,Integer>
io.openems.edge.common.channel.EnumReadChannel
io.openems.edge.common.channel.EnumWriteChannel
- All Implemented Interfaces:
Channel<Integer>
,WriteChannel<Integer>
-
Field Summary
Fields inherited from class io.openems.edge.common.channel.internal.AbstractReadChannel
parent
Fields inherited from interface io.openems.edge.common.channel.Channel
MAX_AGE_OF_PAST_VALUES
-
Constructor Summary
ModifierConstructorDescriptionprotected
EnumWriteChannel
(OpenemsComponent component, ChannelId channelId, EnumDoc channelDoc, OptionsEnum optionsEnum) -
Method Summary
Modifier and TypeMethodDescriptionvoid
_setNextWriteValue
(Integer value) Deprecated.Gets the next write value.Gets the onSetNextWrite callbacks.void
Add an onSetNextWrite callback.void
setNextWriteValue
(OptionsEnum value) Updates the 'next' write value of Channel from an Enum value.void
setNextWriteValue
(String value) Updates the 'next' write value of Channel from an Enum-String value.Methods inherited from class io.openems.edge.common.channel.EnumReadChannel
_setNextValue
Methods inherited from class io.openems.edge.common.channel.internal.AbstractReadChannel
address, channelDoc, channelId, deactivate, getComponent, getMetaInfo, getNextValue, getPastValues, getType, nextProcessImage, onChange, onSetNextValue, onUpdate, removeOnChangeCallback, removeOnSetNextValueCallback, removeOnUpdateCallback, setMetaInfo, toString, value
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.openems.edge.common.channel.Channel
_setNextValue, address, channelDoc, channelId, deactivate, getComponent, getMetaInfo, getNextValue, getPastValues, getType, nextProcessImage, onChange, onSetNextValue, onUpdate, removeOnChangeCallback, removeOnSetNextValueCallback, removeOnUpdateCallback, setMetaInfo, setNextValue, value
Methods inherited from interface io.openems.edge.common.channel.WriteChannel
getNextWriteValueAndReset, setNextWriteValue, setNextWriteValueFromObject
-
Constructor Details
-
EnumWriteChannel
protected EnumWriteChannel(OpenemsComponent component, ChannelId channelId, EnumDoc channelDoc, OptionsEnum optionsEnum)
-
-
Method Details
-
setNextWriteValue
Updates the 'next' write value of Channel from an Enum-String value.- Parameters:
value
- the name of the option as string- Throws:
OpenemsError.OpenemsNamedException
- one error
-
setNextWriteValue
Updates the 'next' write value of Channel from an Enum value.- Parameters:
value
- the OptionsEnum value- Throws:
OpenemsError.OpenemsNamedException
- on error
-
_setNextWriteValue
Deprecated.Internal method. Do not call directly.- Specified by:
_setNextWriteValue
in interfaceWriteChannel<Integer>
- Parameters:
value
- the value as Integer
-
getNextWriteValue
Description copied from interface:WriteChannel
Gets the next write value.- Specified by:
getNextWriteValue
in interfaceWriteChannel<Integer>
- Returns:
- the next write value; not-present if no write value had been set
-
getOnSetNextWrites
Description copied from interface:WriteChannel
Gets the onSetNextWrite callbacks.- Specified by:
getOnSetNextWrites
in interfaceWriteChannel<Integer>
- Overrides:
getOnSetNextWrites
in classAbstractReadChannel<EnumDoc,
Integer> - Returns:
- a List of callbacks
-
onSetNextWrite
Description copied from interface:WriteChannel
Add an onSetNextWrite callback. It is called when a 'next write value' was set.The callback can throw an
OpenemsError.OpenemsNamedException
.- Specified by:
onSetNextWrite
in interfaceWriteChannel<Integer>
- Parameters:
callback
- the callback
-