Class StateCollectorChannel

All Implemented Interfaces:
Channel<Integer>

public class StateCollectorChannel extends EnumReadChannel
Collects the values of all StateChannels. This class is used for the "State" Channel of every OpenEMS Component.
  • Constructor Details

  • Method Details

    • value

      public Value<Integer> value()
      Description copied from interface: Channel
      Gets the currently active value, wrapped in a @{link Value}.
      Specified by:
      value in interface Channel<Integer>
      Overrides:
      value in class AbstractReadChannel<EnumDoc,Integer>
      Returns:
      the active value, never null
    • 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 String listStates()
      Lists all States as Text.
      Returns:
      the text
    • listStates

      public String listStates(Level fromLevel)
      Lists all States that are at least 'fromLevel' as text.
      Parameters:
      fromLevel - the minimum Level
      Returns:
      the text