Class StateCollectorChannel
- java.lang.Object
-
- io.openems.edge.common.channel.internal.AbstractReadChannel<EnumDoc,java.lang.Integer>
-
- io.openems.edge.common.channel.EnumReadChannel
-
- io.openems.edge.common.channel.internal.StateCollectorChannel
-
- All Implemented Interfaces:
Channel<java.lang.Integer>
public class StateCollectorChannel extends EnumReadChannel
Collects the values of allStateChannel
s. This class is used for the "State" Channel of every OpenEMS Component.
-
-
Field Summary
-
Fields inherited from class io.openems.edge.common.channel.internal.AbstractReadChannel
parent
-
Fields inherited from interface io.openems.edge.common.channel.Channel
NO_OF_PAST_VALUES
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
StateCollectorChannel(OpenemsComponent parent, ChannelId channelId, StateCollectorChannelDoc channelDoc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChannel(StateChannel channel)
Adds a Channel to this StateCollector.java.lang.String
listStates()
Lists all States as Text.java.lang.String
listStates(Level fromLevel)
Lists all States that are at least 'fromLevel' as text.void
removeChannel(StateChannel channel)
Removes a Channel from this StateCollector.Value<java.lang.Integer>
value()
Gets the currently active value, wrapped in a @{link 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, getOnSetNextWrites, getPastValues, getType, nextProcessImage, onChange, onSetNextValue, onUpdate, removeOnChangeCallback, removeOnSetNextValueCallback, removeOnUpdateCallback, setMetaInfo, toString
-
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
-
-
-
-
Constructor Detail
-
StateCollectorChannel
protected StateCollectorChannel(OpenemsComponent parent, ChannelId channelId, StateCollectorChannelDoc channelDoc)
-
-
Method Detail
-
value
public Value<java.lang.Integer> value()
Description copied from interface:Channel
Gets the currently active value, wrapped in a @{link Value}.- Specified by:
value
in interfaceChannel<java.lang.Integer>
- Overrides:
value
in classAbstractReadChannel<EnumDoc,java.lang.Integer>
- Returns:
- the active value
-
addChannel
public void addChannel(StateChannel channel)
Adds a Channel to this StateCollector.- Parameters:
channel
- the Channel
-
removeChannel
public void removeChannel(StateChannel channel)
Removes a Channel from this StateCollector.The onChange listener is removed by the
Channel.deactivate()
method.- Parameters:
channel
- the Channel
-
listStates
public java.lang.String listStates()
Lists all States as Text.- Returns:
- the text
-
listStates
public java.lang.String listStates(Level fromLevel)
Lists all States that are at least 'fromLevel' as text.- Parameters:
fromLevel
- the minimum Level- Returns:
- the text
-
-