Class SerialLight

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

public class SerialLight
extends AbstractLight
Implementation of the Light interface using Grapevine signal ports.

The "On" state results in sending a "green" setting to the hardware port; the "Off" state results in sending a "dark" setting to the hardware.

  • Field Details

  • Constructor Details

    • SerialLight

      public SerialLight​(String systemName, GrapevineSystemConnectionMemo _memo)
      Create a Light object, with only system name.
      Parameters:
      systemName - system name including prefix, previously validated in SerialLightManager
      _memo - the associated SystemConnectionMemo
    • SerialLight

      public SerialLight​(String systemName, String userName, GrapevineSystemConnectionMemo _memo)
      Create a Light object, with both system and user names.
      Parameters:
      systemName - system name including prefix, previously validated in SerialLightManager
      userName - free form name
      _memo - the associated SystemConnectionMemo
  • 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
    • sendMessage

      protected void sendMessage​(boolean on)