Class SerialTurnout

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.lang.Comparable<NamedBean>, java.util.EventListener, PropertyChangeProvider, DigitalIO, NamedBean, Turnout, VariableControlSpanBean

    public class SerialTurnout
    extends AbstractTurnout
    Turnout implementation for C/MRI serial systems.

    This object doesn't listen to the C/MRI communications. This is because it should be the only object that is sending messages for this turnout; more than one Turnout object pointing to a single device is not allowed.

    Turnouts on the layout may be controlled by one or two output bits. To control a turnout from one Turnout object via two output bits, the output bits must be on the same node, the Turnout address must point to the first output bit, and the second output bit must follow the output bit at the next address. Valid states for the two bits controlling the two-bit turnout are: ON OFF, and OFF ON for the two bits.

    This class can also drive pulsed outputs, which can be combined with the two-bit option in the expected ways.

    When a Turnout is configured for pulsed and two-output, a request to go to a new CommandedState sets the desired configuration for the pulse interval, then sets both leads to their off condition.

    When a Turnout is configured for pulsed and one output, a request to go to a new CommandedState just sets the output on for the interval; it's assumed that there's something out on the layout that converts that pulse into a "flip to other state" operation.

    Finally, this implementation supports the "inverted" option. Inverted applies to the status of the lead on the C/MRI output itself.

    For example, a pulsed, two-output, inverted turnout will have both pins set to 1 in the resting state. When THROWN, one lead will be set to 0 for the configured interval, then set back to 1.

    For more discussion of this, please see the documentation page.