Package jmri

Interface DigitalIO

All Superinterfaces:
Comparable<NamedBean>, NamedBean, PropertyChangeProvider
All Known Subinterfaces:
Light, Sensor, Turnout, VariableLight
All Known Implementing Classes:
AbstractLight, AbstractSensor, AbstractTurnout, AbstractVariableLight, AcelaLight, AcelaSensor, AcelaTurnout, AnymaDMX_UsbLight, CbusLight, CbusSensor, CbusTurnout, Dcc4PcSensor, DCCppLight, DCCppSensor, DCCppTurnout, EasyDccTurnout, EcosSensor, EcosTurnout, EliteXNetTurnout, IpocsLight, IpocsSensor, IpocsTurnout, JMRIClientLight, JMRIClientSensor, JMRIClientTurnout, LnLight, LnSensor, LnTurnout, MarklinSensor, MarklinTurnout, MqttLight, MqttSensor, MqttTurnout, MrcTurnout, Mx1Turnout, NceLight, NceSensor, NceTurnout, OlcbLight, OlcbSensor, OlcbTurnout, RaspberryPiSensor, RaspberryPiTurnout, RfidSensor, RpsSensor, SerialLight, SerialLight, SerialLight, SerialLight, SerialLight, SerialLight, SerialSensor, SerialSensor, SerialSensor, SerialSensor, SerialSensor, SerialSensor, SerialTurnout, SerialTurnout, SerialTurnout, SerialTurnout, SerialTurnout, SerialTurnout, SerialTurnout, SerialX10Light, SpecificInsteonLight, SpecificInsteonLight, SpecificLight, SpecificLight, SpecificX10Light, SpecificX10Light, SprogCSTurnout, SprogTurnout, SRCPSensor, SRCPTurnout, TamsSensor, TamsTurnout, TimeoutRfidSensor, XBeeLight, XBeeSensor, XBeeTurnout, XNetLight, XNetSensor, XNetTurnout, XpaTurnout, Z21CanSensor, Z21RMBusSensor, Z21XNetTurnout, ZTC611XNetTurnout

public interface DigitalIO
extends NamedBean
Represent a digital I/O on the layout.
  • Field Details

  • Method Details

    • isConsistentState

      Show whether state is stable. For turnouts, a consistent state is one you can safely run trains over. For lights, it's a state which is either on or off, not in between.
      Returns:
      true if state is valid and the known state is the same as commanded
    • setCommandedState

      Change the commanded state, which results in the relevant command(s) being sent to the hardware. The exception is thrown if there are problems communicating with the layout hardware.
      Parameters:
      s - the desired state
    • getCommandedState

      Query the commanded state. This is a bound parameter, so you can also register a listener to be informed of changes.
      Returns:
      the commanded state
    • getKnownState

      Query the known state. This is a bound parameter, so you can also register a listener to be informed of changes. A result is always returned; if no other feedback method is available, the commanded state will be used.
      Returns:
      the known state
    • requestUpdateFromLayout

      Request an update from the layout soft/hardware. May not even happen, and if it does it will happen later; listen for the result.