jmri.jmrit.logix
Class OPath

java.lang.Object
  extended by jmri.Path
      extended by jmri.jmrit.logix.OPath

public class OPath
extends Path

Extends jmri.Path. An OPath is a route that traverses a Block from one boundary to another. The mBlock parameter of Path 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 wich it enters or exits the block. One of these may be null, if the OPath dead ends within the block.

Author:
Pete Cressman Copyright (C) 2009

Field Summary
 
Fields inherited from class jmri.Path
CCW, CW, DOWN, EAST, LEFT, NONE, NORTH, RIGHT, SOUTH, UP, WEST
 
Constructor Summary
OPath(Block owner, int toBlockDirection, int fromBlockDirection)
           
OPath(Block owner, int toBlockDirection, int fromBlockDirection, BeanSetting setting)
           
OPath(Block owner, String name)
          Create an object with default directions of NONE, and no setting element.
OPath(String name, OBlock owner, Portal entry, int fromBlockDirection, Portal exit, int toBlockDirection)
           
 
Method Summary
 void dispose()
           
 String getDescription()
           
 Portal getFromPortal()
           
 String getName()
           
protected  String getOppositePortalName(String name)
           
 Portal getToPortal()
           
 void setBlock(Block block)
           
 void setFromPortal(Portal p)
           
 void setName(String name)
           
 void setToPortal(Portal p)
           
 void setTurnouts(int delay, boolean set, int lockState, boolean lock)
          Set path turnout commanded state and lock state
 String toString()
           
protected  boolean validatePortals()
           
 
Methods inherited from class jmri.Path
addSetting, checkPathSet, clearSettings, decodeDirection, getBlock, getFromBlockDirection, getSettings, getToBlockDirection, removeSetting, setFromBlockDirection, setToBlockDirection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OPath

public OPath(Block owner,
             String name)
Create an object with default directions of NONE, and no setting element.


OPath

public OPath(Block owner,
             int toBlockDirection,
             int fromBlockDirection)

OPath

public OPath(Block owner,
             int toBlockDirection,
             int fromBlockDirection,
             BeanSetting setting)

OPath

public OPath(String name,
             OBlock owner,
             Portal entry,
             int fromBlockDirection,
             Portal exit,
             int toBlockDirection)
Method Detail

setBlock

public void setBlock(Block block)
Overrides:
setBlock in class Path

getOppositePortalName

protected String getOppositePortalName(String name)

validatePortals

protected boolean validatePortals()

setName

public void setName(String name)

getName

public String getName()

setFromPortal

public void setFromPortal(Portal p)

getFromPortal

public Portal getFromPortal()

setToPortal

public void setToPortal(Portal p)

getToPortal

public Portal getToPortal()

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)

dispose

public void dispose()

getDescription

public String getDescription()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads