jmri.jmrit.logix
Class OPath
java.lang.Object
jmri.Path
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
| 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)
|
| Methods inherited from class jmri.Path |
addSetting, checkPathSet, clearSettings, decodeDirection, getBlock, getFromBlockDirection, getSettings, getToBlockDirection, removeSetting, setFromBlockDirection, setToBlockDirection |
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)
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 secondsset - when true, command turnout to settings, false don't set command - just do lock settinglockState - set when lock==true, lockState unset when lock==falselock - 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: