Class SerialLight

All Implemented Interfaces:
Comparable<NamedBean>, PropertyChangeProvider, DigitalIO, Light, NamedBean

public class SerialLight
extends AbstractLight
Implementation of the Light Object for C/MRI

Based in part on SerialTurnout.java

  • Field Details

    • mBit

      int mBit
      System dependent instance variables
  • Constructor Details

    • SerialLight

      public SerialLight​(String systemName, MapleSystemConnectionMemo memo)
      Create a Light object, with only system name.

      'systemName' has already been validated in SerialLightManager

      Parameters:
      systemName - the system name for this Light
      memo - system connection.
    • SerialLight

      public SerialLight​(String systemName, String userName, MapleSystemConnectionMemo memo)
      Create a Light object, with both system and user names.

      'systemName' has already been validated in SerialLightManager

      Parameters:
      systemName - the system name for this Light
      userName - the user name for this Light
      memo - system connection.
  • Method Details

    • doNewState

      protected void doNewState​(int oldState, int newState)
      Set the current state of this Light This routine requests the hardware to change. If this is really a change in state of this bit (tested in SerialNode), a Transmit packet will be sent before this Node is next polled.
      Overrides:
      doNewState in class AbstractLight
      Parameters:
      oldState - old state
      newState - new state