Class OPath

  • All Implemented Interfaces:
    java.lang.Comparable<Path>

    public class OPath
    extends Path
    Extends jmri.Path. An OPath is a route that traverses a Block from one boundary to another. The dest parameter of Path (renamed to owner) is used to reference the Block to which this OPath belongs. (Not a destination Block as might be inferred from the naming in Path.java)

    An OPath inherits the List of BeanSettings for all the turnouts needed to traverse the Block. It also has references to the Portals (block boundary objects) through which it enters or exits the block. One of these may be null, if the OPath dead ends within the block.

    • Constructor Detail

      • OPath

        public OPath​(Block owner,
                     java.lang.String name)
        Create an OPath object with default directions of NONE, and no setting element.
        Parameters:
        owner - Block owning the path
        name - name of the path
      • OPath

        public OPath​(java.lang.String name,
                     OBlock owner,
                     Portal entry,
                     Portal exit,
                     java.util.List<BeanSetting> settings)
        Create an OPath object with default directions of NONE, and no setting element.
        Parameters:
        owner - Block owning the path
        name - name of the path
        entry - Portal where path enters
        exit - Portal where path exits
        settings - array of turnout settings of the path
    • Method Detail

      • setName

        public void setName​(java.lang.String name)
      • getName

        public java.lang.String getName()
      • setTurnouts

        public void setTurnouts​(int delay,
                                boolean set,
                                int lockState,
                                boolean lock)
        Set path turnout commanded state and lock state
        Parameters:
        delay - following actions in seconds
        set - when true, command turnout to settings, false don't set command - just do lock setting
        lockState - set when lock==true, lockState unset when lock==false
        lock - If lockState==0 setLocked() is not called. (lockState should be 1,2,3)
      • equals

        public boolean equals​(java.lang.Object obj)
        Override to indicate logical equality for use as paths in OBlocks.
        Overrides:
        equals in class Path