Package jmri.jmrit.logix
Class OPath
- java.lang.Object
-
- jmri.Path
-
- jmri.jmrit.logix.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.
-
-
Field Summary
-
Fields inherited from class jmri.Path
CCW, CW, DOWN, EAST, LEFT, NONE, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, UP, WEST
-
-
Constructor Summary
Constructors Constructor Description 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.OPath(Block owner, java.lang.String name)
Create an OPath object with default directions of NONE, and no setting element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSetting(BeanSetting t)
Does not allow duplicate settings.void
dispose()
boolean
equals(java.lang.Object obj)
Override to indicate logical equality for use as paths in OBlocks.java.lang.String
getDescription()
Portal
getFromPortal()
java.lang.String
getName()
protected java.lang.String
getOppositePortalName(java.lang.String name)
Portal
getToPortal()
int
hashCode()
void
setFromPortal(Portal p)
void
setName(java.lang.String name)
void
setToPortal(Portal p)
void
setTurnouts(int delay, boolean set, int lockState, boolean lock)
Set path turnout commanded state and lock statejava.lang.String
toString()
-
Methods inherited from class jmri.Path
checkPathSet, clearSettings, compareTo, computeDirection, decodeDirection, getBlock, getFromBlockDirection, getLength, getLengthCm, getLengthIn, getLengthMm, getSettings, getToBlockDirection, removeSetting, reverseDirection, setBlock, setFromBlockDirection, setLength, setToBlockDirection
-
-
-
-
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 pathname
- 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 pathname
- name of the pathentry
- Portal where path entersexit
- Portal where path exitssettings
- array of turnout settings of the path
-
-
Method Detail
-
getOppositePortalName
protected java.lang.String getOppositePortalName(java.lang.String name)
-
setName
public void setName(java.lang.String name)
-
getName
public java.lang.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 java.lang.String getDescription()
-
addSetting
public void addSetting(BeanSetting t)
Does not allow duplicate settings.- Overrides:
addSetting
in classPath
-
-