Package jmri

Interface DigitalIO

    • Method Detail

      • isConsistentState

        boolean 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

        @InvokeOnLayoutThread
        void setCommandedState​(int s)
        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

        int 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

        int 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