Package io.openems.edge.common.channel
Class EnumDoc
- All Implemented Interfaces:
Doc
- Direct Known Subclasses:
StateCollectorChannelDoc
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateChannelInstance
(OpenemsComponent component, ChannelId channelId) debounce
(int debounce) Debounce the Enum-Channel value: The EnumChannel is only set to the given value after it had been set to the same value for at least "debounce" times.Gets theChannelCategory
of the Channel of this Doc.int
Gets theOptionsEnum
from the integer value.getOptionFromString
(String name) Gets the Option from a String.getOptionString
(Integer value) Gets the name of the Option or 'UNDEFINED' if there is no option with that value.int
Gets the Option value from a String.getText()
Gets the descriptive text.Gets the Undefined-Option, i.e.initialValue
(OptionsEnum initialValue) Initial-Value.protected EnumDoc
self()
Gets an instance of the correct subclass of myself.Methods inherited from class io.openems.edge.common.channel.internal.AbstractDoc
accessMode, debug, getAccessMode, getInitialValue, getOnInitCallbacks, getPersistencePriority, getType, getUnit, initialValue, isDebug, onChannelChange, onChannelChange, onChannelSetNextValue, onChannelSetNextWrite, onChannelSetNextWriteMirrorToDebugChannel, onChannelUpdate, onInit, persistencePriority, text
-
Field Details
-
debounce
protected int debounce
-
-
Constructor Details
-
EnumDoc
-
-
Method Details
-
getChannelCategory
Description copied from interface:Doc
Gets theChannelCategory
of the Channel of this Doc.- Returns:
- the ChannelCategory
-
self
Description copied from class:AbstractDoc
Gets an instance of the correct subclass of myself.- Specified by:
self
in classAbstractDoc<Integer>
- Returns:
- myself
-
getOptions
-
initialValue
Initial-Value. Default: none- Parameters:
initialValue
- the initial value asOptionsEnum
- Returns:
- myself
-
createChannelInstance
- Specified by:
createChannelInstance
in interfaceDoc
- Specified by:
createChannelInstance
in classAbstractDoc<Integer>
- Parameters:
channelId
- the Channel-IDcomponent
- theOpenemsComponent
- Returns:
- the Channel
-
getUndefinedOption
Gets the Undefined-Option, i.e. the default Option if the value has not been set.- Returns:
- the Undefined-Option
-
getOptionFromString
Gets the Option from a String.- Parameters:
name
- the name of the option. Comparison is case insensitive- Returns:
- the
OptionsEnum
- Throws:
OpenemsError.OpenemsNamedException
- if there is no option with that name
-
getOptionValueFromString
Gets the Option value from a String.- Parameters:
name
- the name of the option. Comparison is case insensitive- Returns:
- the integer value of the
OptionsEnum
- Throws:
OpenemsError.OpenemsNamedException
- if there is no option with that name
-
getOption
Gets theOptionsEnum
from the integer value.- Parameters:
value
- the integer value of the option- Returns:
- the
OptionsEnum
-
getOptionString
Gets the name of the Option or 'UNDEFINED' if there is no option with that value.- Parameters:
value
- the integer value of the Option- Returns:
- the name of the Option as a String
-
getText
Description copied from interface:Doc
Gets the descriptive text. Defaults to empty String.- Specified by:
getText
in interfaceDoc
- Overrides:
getText
in classAbstractDoc<Integer>
- Returns:
- the text
-
debounce
Debounce the Enum-Channel value: The EnumChannel is only set to the given value after it had been set to the same value for at least "debounce" times.Currently only working for read-only.
- Parameters:
debounce
- "debounce" times- Returns:
- EnumDoc
-
getDebounce
public int getDebounce()
-