Class SimpleTurnoutStateEntry

java.lang.Object
jmri.jmrix.loconet.ds64.SimpleTurnout
jmri.jmrix.loconet.ds64.SimpleTurnoutStateEntry

public class SimpleTurnoutStateEntry
extends SimpleTurnout
Provides a swing object, for use by the Ds64TabbedPanel tool, which allows display and configuration of turnout number and position.

Turnout numbering is the same as seen on a Digitrax throttle display; Tools using values from objects of this type must provide the appropriate transform to create turnout numbering which is suitable for use within LocoNet messaging.

  • Field Details

  • Constructor Details

    • SimpleTurnoutStateEntry

      Constructor used when the current address and position are not known. It is assumed that the turnout address is 1, that the turnout is "closed", and that the turnout is "valid".

      Turnout numbering is the same as seen on a Digitrax throttle display; Tools using values from objects of this type must provide the appropriate transform to create turnout numbering which is suitable for use within LocoNet messaging.

    • SimpleTurnoutStateEntry

      public SimpleTurnoutStateEntry​(Integer address, boolean isClosed)
      Constructor used when the current address and position are known. Turnout "validity" is assumed to be "valid".

      Turnout numbering is the same as seen on a Digitrax throttle display; Tools using values from objects of this type must provide the appropriate transform to create turnout numbering which is suitable for use within LocoNet messaging.

      Parameters:
      address - turnout address
      isClosed - true if turnout is closed, else false
    • SimpleTurnoutStateEntry

      public SimpleTurnoutStateEntry​(Integer address, boolean closed, boolean unused)
      Constructor used when the current address, position, and "validity" state are known.

      Turnout numbering is the same as seen on a Digitrax throttle display; Tools using values from objects of this type must provide the appropriate transform to create turnout numbering which is suitable for use within LocoNet messaging.

      Parameters:
      address - turnout address
      closed - true if turnout is closed, else false
      unused - true if turnout is unused, else false
  • Method Details

    • getEntryPanel

      Returns:
      the JPanel related to this object
    • createEntryPanel

      public JPanel createEntryPanel​(String label)
      Creates a GUI Panel for managing the address and position of a turnout, as used in configuring the turnout address of a DS64 output.
      Parameters:
      label - a text string to be displayed in the JPanel with the turnout address and position
      Returns:
      a JPanel containing the label, the turnout address text field, and position GUI elements
    • getAddressField

      Retrieve the GUI element which holds a turnout address
      Returns:
      turnout address
    • setAddress

      public void setAddress​(Integer addr)
      Description copied from class: SimpleTurnout
      Sets the turnout address of the simpleTurnout object.
      Overrides:
      setAddress in class SimpleTurnout
      Parameters:
      addr - address value
    • setAddressLastQueriedValue

      public final void setAddressLastQueriedValue​(Integer addr)
      Establish the most recent value known to be found in the hardware. Value is used to help determine colorization of the swing GUI text field.
      Parameters:
      addr - Turnout address
    • setIsClosed

      public void setIsClosed​(boolean isclosed)
      Description copied from class: SimpleTurnout
      Sets an object field to show the current position of a simpleTurnout object. This position does not necessarily reflect the actual position of an associated physical turnout.
      Overrides:
      setIsClosed in class SimpleTurnout
      Parameters:
      isclosed - true if the object is to be marked as closed.