jmri.jmrit.logix
Class Portal

java.lang.Object
  extended by jmri.jmrit.logix.Portal

public class Portal
extends Object

An Portal is a boundary between two Blocks.

A Portal has Lists of the OPaths that connect through it.

Author:
Pete Cressman Copyright (C) 2009

Constructor Summary
Portal(OBlock fromBlock, String portalName, OBlock toBlock)
           
 
Method Summary
 boolean addPath(OPath path)
          Determine which list the Path belongs to and add it to the list
 void deleteSignal(NamedBean signal)
           
 void dispose()
           
 String getDescription()
           
 long getEntranceSpeedChangeWaitForBlock(OBlock block)
           
 OBlock getFromBlock()
           
 String getFromBlockName()
           
 List<OPath> getFromPaths()
           
 NamedBean getFromSignal()
           
 long getFromSignalDelay()
           
 String getFromSignalName()
           
 String getName()
           
 OBlock getOpposingBlock(OBlock block)
          Return the block on the other side of the portal from this (the param) block
 List<OPath> getPathsFromOpposingBlock(OBlock block)
          Get the paths from the portal in the next connected Block i.e. paths in the block on the other side of the portal from this (the param) block
 List<OPath> getPathsWithinBlock(OBlock block)
          Get the paths to the portal within the connected Block i.e. the paths in this (the param) block through the Portal
 String getPermissibleSpeedForBlock(OBlock block)
          Check signals, if any, for speed into next block.
static NamedBean getSignal(String name)
           
 NamedBean getSignalProtectingBlock(OBlock block)
           
 OBlock getToBlock()
           
 String getToBlockName()
           
 List<OPath> getToPaths()
           
 NamedBean getToSignal()
           
 long getToSignalDelay()
           
 String getToSignalName()
           
 boolean isValid()
           
 void removePath(OPath path)
           
 boolean setApproachSignal(NamedBean signal, long time, OBlock approachBlock)
           
 boolean setFromBlock(OBlock block, boolean changePaths)
          Set block name.
 String setName(String name)
          Check for duplicate name in either block
 boolean setProtectSignal(NamedBean signal, long time, OBlock protectedBlock)
           
 boolean setToBlock(OBlock block, boolean changePaths)
          Set block name.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Portal

public Portal(OBlock fromBlock,
              String portalName,
              OBlock toBlock)
Method Detail

addPath

public boolean addPath(OPath path)
Determine which list the Path belongs to and add it to the list

Returns:
false if Path does not have a matching block for this Portal

removePath

public void removePath(OPath path)

setName

public String setName(String name)
Check for duplicate name in either block

Returns:
return error message, return null if name change is OK

getName

public String getName()

setToBlock

public boolean setToBlock(OBlock block,
                          boolean changePaths)
Set block name. Verify that all toPaths are contained in the block.

Returns:
false if paths are not in the block

getToBlock

public OBlock getToBlock()

getToBlockName

public String getToBlockName()

getToPaths

public List<OPath> getToPaths()

setFromBlock

public boolean setFromBlock(OBlock block,
                            boolean changePaths)
Set block name. Verify that all fromPaths are contained in the block.

Returns:
false if paths are not in the block

getFromBlock

public OBlock getFromBlock()

getFromBlockName

public String getFromBlockName()

getFromPaths

public List<OPath> getFromPaths()

setProtectSignal

public boolean setProtectSignal(NamedBean signal,
                                long time,
                                OBlock protectedBlock)

setApproachSignal

public boolean setApproachSignal(NamedBean signal,
                                 long time,
                                 OBlock approachBlock)

getFromSignal

public NamedBean getFromSignal()

getFromSignalName

public String getFromSignalName()

getFromSignalDelay

public long getFromSignalDelay()

getToSignal

public NamedBean getToSignal()

getToSignalName

public String getToSignalName()

getToSignalDelay

public long getToSignalDelay()

deleteSignal

public void deleteSignal(NamedBean signal)

getSignal

public static NamedBean getSignal(String name)

getPathsWithinBlock

public List<OPath> getPathsWithinBlock(OBlock block)
Get the paths to the portal within the connected Block i.e. the paths in this (the param) block through the Portal

Parameters:
block -
Returns:
null if portal does not connect to block

getOpposingBlock

public OBlock getOpposingBlock(OBlock block)
Return the block on the other side of the portal from this (the param) block


getPathsFromOpposingBlock

public List<OPath> getPathsFromOpposingBlock(OBlock block)
Get the paths from the portal in the next connected Block i.e. paths in the block on the other side of the portal from this (the param) block

Parameters:
block -
Returns:
null if portal does not connect to block

getSignalProtectingBlock

public NamedBean getSignalProtectingBlock(OBlock block)
Parameters:
block - is the direction of entry
Returns:
signal protecting block

getPermissibleSpeedForBlock

public String getPermissibleSpeedForBlock(OBlock block)
Check signals, if any, for speed into next block. The signal that protects the "to" block is the signal facing the "from" Block, i.e. the "from" signal. (and vice-versa)

Parameters:
block - is the direction of entry, "from" block
Returns:
permissible speed

getEntranceSpeedChangeWaitForBlock

public long getEntranceSpeedChangeWaitForBlock(OBlock block)

isValid

public boolean isValid()

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