Class DispatcherFrame
- All Implemented Interfaces:
ComponentListener
,WindowListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,RootPaneContainer
,WindowConstants
,BeanInterface
,InstanceManagerAutoDefault
,ModifiedFlag
,WindowInterface
public class DispatcherFrame extends JmriJFrame implements InstanceManagerAutoDefault
Dispatcher serves as the manager for ActiveTrains. All allocation of Sections to ActiveTrains is performed here.
Programming Note: Use the managed instance returned by
InstanceManager.getDefault(java.lang.Class)
to access the
running Dispatcher.
Dispatcher listens to fast clock minutes to handle all ActiveTrain items tied to fast clock time.
Delayed start of manual and automatic trains is enforced by not allocating Sections for trains until the fast clock reaches the departure time.
This file is part of JMRI.
JMRI is open source software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DispatcherFrame.ActiveTrainsTableModel
Table model for Active Trains Table in Dispatcher windowclass
DispatcherFrame.AllocatedSectionTableModel
Table model for Allocated Section Tableclass
DispatcherFrame.AllocationRequestTableModel
Table model for Allocation Request Table in Dispatcher windowprotected static class
DispatcherFrame.HeaderActionListener
(package private) static class
DispatcherFrame.HeldMastDetails
(package private) class
DispatcherFrame.TableHeaderListener
Class to support Columnheader popup menu on XTableColum model.Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Nested classes/interfaces inherited from interface jmri.util.swing.WindowInterface
WindowInterface.Hint
-
Field Summary
Fields Modifier and Type Field Description protected List<AllocatedSection>
allocatedSections
protected JmriJFrame
dispatcherFrame
(package private) List<DispatcherFrame.HeldMastDetails>
heldMasts
static String
OVERRIDETYPE_DCCADDRESS
static String
OVERRIDETYPE_NONE
Constants for the override typestatic String
OVERRIDETYPE_OPERATIONS
static String
OVERRIDETYPE_ROSTER
static String
OVERRIDETYPE_USER
static int
SECTIONSALLOCATED
static int
SIGNALHEAD
static int
SIGNALMAST
Fields inherited from class jmri.util.JmriJFrame
allowInFrameServlet, properties, reuseFrameSavedPosition, reuseFrameSavedSized, windowInterface
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
Constructors Constructor Description DispatcherFrame()
-
Method Summary
Modifier and Type Method Description protected void
addDelayedTrain(ActiveTrain at)
protected void
addMouseListenerToHeader(JTable table)
Adds the column header pop listener to a JTable using XTableColumnModelvoid
allocateExtraSection(ActionEvent e, ActiveTrain at)
void
allocateNewActiveTrain(ActiveTrain at)
(package private) void
allocateNextRequested(int index)
AllocatedSection
allocateSection(AllocationRequest ar, Section ns)
Allocates a Section to an Active Train according to the information in an AllocationRequest.(package private) void
cancelRestart(ActionEvent e)
protected void
checkAutoRelease()
Check if any allocation requests need to be allocated, or if any allocated sections need to be releasedprotected Section
checkBlocksNotInAllocatedSection(Section s, AllocationRequest ar)
(package private) boolean
checkTurnoutStates(Section s, int sSeqNum, Section nextSection, ActiveTrain at, Section prevSection)
ActiveTrain
createActiveTrain(String transitID, String trainID, int tSource, String startBlockName, int startBlockSectionSequenceNumber, String endBlockName, int endBlockSectionSequenceNumber, boolean autoRun, String dccAddress, int priority, boolean resetWhenDone, boolean reverseAtEnd, boolean showErrorMessages, JmriJFrame frame, int allocateMethod)
Creates a new ActiveTrain, and registers it with Dispatcher.protected void
doReleaseAllocatedSection(AllocatedSection as, boolean terminatingTrain)
boolean
extendActiveTrainsPath(Section s, ActiveTrain at, JmriJFrame jFrame)
Extend the allocation of a section to a active train.protected AllocationRequest
findAllocationRequestInQueue(Section s, int seq, int dir, ActiveTrain at)
ActiveTrain
getActiveTrainForRoster(RosterEntry re)
ActivateTrainFrame
getActiveTrainFrame()
List<ActiveTrain>
getActiveTrainsList()
protected List<AllocatedSection>
getAllocatedSectionsList()
protected boolean
getAutoAllocate()
protected boolean
getAutoRelease()
AutoTrainsFrame
getAutoTrainsFrame()
protected boolean
getAutoTurnouts()
protected boolean
getExtraColorForAllocated()
protected int
getFullRampTime()
protected boolean
getHasOccupancyDetection()
protected LayoutEditor
getLayoutEditor()
protected float
getMaximumLineSpeed()
protected int
getMinThrottleInterval()
protected boolean
getNameInAllocatedBlock()
boolean
getNewTrainActive()
protected boolean
getRosterEntryInBlock()
protected Scale
getScale()
String
getSectionName(Section sec)
protected boolean
getSetSSLDirectionalSensors()
protected boolean
getShortActiveTrainNames()
protected boolean
getShortNameInBlock()
protected int
getSignalType()
protected String
getSignalTypeString()
protected String
getStoppingSpeedName()
protected boolean
getSupportVSDecoder()
protected boolean
getTrainsFromRoster()
protected boolean
getTrainsFromTrains()
protected boolean
getTrainsFromUser()
protected boolean
getTrustKnownTurnouts()
protected boolean
getUseConnectivity()
protected boolean
getUseScaleMeters()
(package private) void
initializeOptions()
boolean
isFastClockTimeGE(int hr, int min)
This method tests timeboolean
isMastHeldByDispatcher(SignalMast sm, ActiveTrain at)
void
loadAtStartup()
reads thru all the traininfo files found in the dispatcher directory and loads the ones flagged as "loadAtStartup"int
loadTrainFromTrainInfo(String traininfoFileName)
Loads a train into the Dispatcher from a traininfo fileint
loadTrainFromTrainInfo(String traininfoFileName, String overRideType, String overRideValue)
Loads a train into the Dispatcher from a traininfo file, overriding dccaddressint
loadTrainFromTrainInfo(TrainInfo info)
Loads a train into the Dispatcherint
loadTrainFromTrainInfo(TrainInfo info, String overRideType, String overRideValue)
Loads a train into the Dispatcherprotected void
newFastClockMinute()
Handle activity that is triggered by the fast clockvoid
newTrainDone(ActiveTrain at)
(package private) void
openDispatcherWindow()
protected void
queueReleaseOfCompletedAllocations()
protected void
queueReleaseOfReservedSections(String trainName)
protected void
queueScanOfAllocationRequests()
protected void
queueWaitForEmpty()
void
releaseAllocatedSection(AllocatedSection as, boolean terminatingTrain)
Releases an allocated Section, and removes it from the Dispatcher Input.(package private) void
releaseAllocatedSectionFromTable(int index)
protected void
removeDelayedTrain(ActiveTrain at)
boolean
removeFromActiveTrainPath(Section s, ActiveTrain at, JmriJFrame jFrame)
protected boolean
requestAllocation(ActiveTrain activeTrain, Section section, int direction, int seqNumber, boolean showErrorMessages, JmriJFrame frame)
Creates an Allocation Request, and registers it with Dispatchervoid
sectionOccupancyChanged()
Updates display when occupancy of an allocated section changes Also drives auto release if it is selectedprotected void
setAutoAllocate(boolean set)
protected void
setAutoRelease(boolean set)
protected void
setAutoTurnouts(boolean set)
protected void
setExtraColorForAllocated(boolean set)
protected void
setFullRampTime(int set)
protected void
setHasOccupancyDetection(boolean set)
protected void
setLayoutEditor(LayoutEditor editor)
protected void
setMinThrottleInterval(int set)
protected void
setNameInAllocatedBlock(boolean set)
void
setNewTrainActive(boolean boo)
protected void
setRosterEntryInBlock(boolean set)
protected void
setScale(Scale sc)
protected void
setSetSSLDirectionalSensors(boolean set)
protected void
setShortActiveTrainNames(boolean set)
protected void
setShortNameInBlock(boolean set)
protected void
setSignalType(int type)
protected void
setStoppingSpeedName(String speedName)
protected void
setSupportVSDecoder(boolean set)
protected void
setTrainsFromRoster(boolean set)
protected void
setTrainsFromTrains(boolean set)
protected void
setTrainsFromUser(boolean set)
protected void
setTrustKnownTurnouts(boolean set)
protected void
setUseConnectivity(boolean set)
protected void
setUseScaleMeters(boolean set)
protected void
showTableHeaderPopup(MouseEvent e, JTable table)
Process the column header clickprotected void
stopStartAutoAllocateRelease()
void
terminateActiveTrain(ActiveTrain at)
Terminate an Active Train and remove it from the Dispatcher.(package private) void
terminateTrain(ActionEvent e)
Methods inherited from class jmri.util.JmriJFrame
addHelpMenu, addNotify, componentHidden, componentMoved, componentResized, componentShown, dispose, generateWindowRef, getAllowInFrameServlet, getEscapeKeyAction, getEscapeKeyClosesWindow, getFrame, getFrame, getFrameList, getFrameList, getIndexedProperty, getMaximumSize, getModifiedFlag, getPreferredSize, getProperty, getPropertyNames, getSavePosition, getSaveSize, getScreenDimensions, getWindowFrameRef, getWindowInterface, handleModified, hasIndexedProperty, hasProperty, initComponents, makePrivateWindow, markWindowModified, multipleInstances, pack, setAllowInFrameServlet, setEscapeKeyAction, setEscapeKeyClosesWindow, setFrameLocation, setIndexedProperty, setModifiedFlag, setProperty, setSavePosition, setSaveSize, setShutDownTask, setWindowInterface, show, show, storeValues, undecorate, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
Methods inherited from class java.awt.Frame
getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
OVERRIDETYPE_NONE
Constants for the override type- See Also:
- Constant Field Values
-
OVERRIDETYPE_USER
- See Also:
- Constant Field Values
-
OVERRIDETYPE_DCCADDRESS
- See Also:
- Constant Field Values
-
OVERRIDETYPE_OPERATIONS
- See Also:
- Constant Field Values
-
OVERRIDETYPE_ROSTER
- See Also:
- Constant Field Values
-
SIGNALHEAD
- See Also:
- Constant Field Values
-
SIGNALMAST
- See Also:
- Constant Field Values
-
SECTIONSALLOCATED
- See Also:
- Constant Field Values
-
allocatedSections
-
dispatcherFrame
-
heldMasts
-
-
Constructor Details
-
DispatcherFrame
public DispatcherFrame()
-
-
Method Details
-
loadAtStartup
reads thru all the traininfo files found in the dispatcher directory and loads the ones flagged as "loadAtStartup" -
loadTrainFromTrainInfo
Loads a train into the Dispatcher from a traininfo file- Parameters:
traininfoFileName
- the file name of a traininfo file.- Returns:
- 0 good, -1 create failure, -2 -3 file errors, -9 bother.
-
loadTrainFromTrainInfo
public int loadTrainFromTrainInfo(String traininfoFileName, String overRideType, String overRideValue)Loads a train into the Dispatcher from a traininfo file, overriding dccaddress- Parameters:
traininfoFileName
- the file name of a traininfo file.overRideType
- "NONE", "USER", "ROSTER" or "OPERATIONS"overRideValue
- "" , dccAddress, RosterEntryName or Operations trainname.- Returns:
- 0 good, -1 create failure, -2 -3 file errors, -9 bother.
-
loadTrainFromTrainInfo
Loads a train into the Dispatcher- Parameters:
info
- a completed TrainInfo class.- Returns:
- 0 good, -1 failure
-
loadTrainFromTrainInfo
Loads a train into the Dispatcher- Parameters:
info
- a completed TrainInfo class.overRideType
- "NONE", "USER", "ROSTER" or "OPERATIONS"overRideValue
- "" , dccAddress, RosterEntryName or Operations trainname.- Returns:
- 0 good, -1 failure
-
getActiveTrainFrame
-
getNewTrainActive
-
setNewTrainActive
-
initializeOptions
void initializeOptions() -
openDispatcherWindow
void openDispatcherWindow() -
releaseAllocatedSectionFromTable
-
allocateExtraSection
-
queueScanOfAllocationRequests
-
queueReleaseOfReservedSections
-
queueWaitForEmpty
-
queueReleaseOfCompletedAllocations
-
getSectionName
-
extendActiveTrainsPath
Extend the allocation of a section to a active train. Allows a dispatcher to manually route a train to its final destination.- Parameters:
s
- the section to allocateat
- the associated trainjFrame
- the window to update- Returns:
- true if section was allocated; false otherwise
-
removeFromActiveTrainPath
-
cancelRestart
-
terminateTrain
-
allocateNextRequested
-
createActiveTrain
public ActiveTrain createActiveTrain(String transitID, String trainID, int tSource, String startBlockName, int startBlockSectionSequenceNumber, String endBlockName, int endBlockSectionSequenceNumber, boolean autoRun, String dccAddress, int priority, boolean resetWhenDone, boolean reverseAtEnd, boolean showErrorMessages, JmriJFrame frame, int allocateMethod)Creates a new ActiveTrain, and registers it with Dispatcher.- Parameters:
transitID
- system or user name of a Transit in the Transit TabletrainID
- any text that identifies the traintSource
- either ROSTER, OPERATIONS, or USER (see ActiveTrain.java)startBlockName
- system or user name of Block where train currently residesstartBlockSectionSequenceNumber
- sequence number in the Transit of the Section containing the startBlock (if the startBlock is within the Transit), or of the Section the train will enter from the startBlock (if the startBlock is outside the Transit)endBlockName
- system or user name of Block where train will end up after its transitendBlockSectionSequenceNumber
- sequence number in the Transit of the Section containing the endBlock.autoRun
- set to "true" if computer is to run the train automatically, otherwise "false"dccAddress
- required if "autoRun" is "true", set to null otherwisepriority
- any integer, higher number is higher priority. Used to arbitrate allocation request conflictsresetWhenDone
- set to "true" if the Active Train is capable of continuous running and the user has requested that it be automatically reset for another run thru its Transit each time it completes running through its Transit.reverseAtEnd
- true if train should automatically reverse at end of transit; false otherwiseshowErrorMessages
- "true" if error message dialogs are to be displayed for detected errors Set to "false" to suppress error message dialogs from this method.frame
- window request is from, or "null" if not from a windowallocateMethod
- How allocations will be performed. 999 - Allocate as many section from start to finish as it can 0 - Allocate to the next "Safe" section. If it cannot allocate all the way to the next "safe" section it does not allocate any sections. It will not allocate beyond the next safe section until it arrives there. This is useful for bidirectional single track running. Any other positive number (in reality thats 1-150 as the create transit allows a max of 150 sections) allocate the specified number of sections a head.- Returns:
- a new ActiveTrain or null on failure
-
allocateNewActiveTrain
-
terminateActiveTrain
Terminate an Active Train and remove it from the Dispatcher. The ActiveTrain object should not be used again after this method is called.- Parameters:
at
- the train to terminate
-
requestAllocation
protected boolean requestAllocation(ActiveTrain activeTrain, Section section, int direction, int seqNumber, boolean showErrorMessages, JmriJFrame frame)Creates an Allocation Request, and registers it with DispatcherRequired input entries:
- Parameters:
activeTrain
- ActiveTrain requesting the allocationsection
- Section to be allocateddirection
- direction of travel in the allocated SectionseqNumber
- sequence number of the Section in the Transit of the ActiveTrain. If the requested Section is not in the Transit, a sequence number of -99 should be entered.showErrorMessages
- "true" if error message dialogs are to be displayed for detected errors Set to "false" to suppress error message dialogs from this method.frame
- window request is from, or "null" if not from a window- Returns:
- true if successful; false otherwise
-
findAllocationRequestInQueue
protected AllocationRequest findAllocationRequestInQueue(Section s, int seq, int dir, ActiveTrain at) -
addDelayedTrain
-
allocateSection
Allocates a Section to an Active Train according to the information in an AllocationRequest.If successful, returns an AllocatedSection and removes the AllocationRequest from the queue. If not successful, returns null and leaves the AllocationRequest in the queue.
To be allocatable, a Section must be FREE and UNOCCUPIED. If a Section is OCCUPIED, the allocation is rejected unless the dispatcher chooses to override this restriction. To be allocatable, the Active Train must not be waiting for its start time. If the start time has not been reached, the allocation is rejected, unless the dispatcher chooses to override the start time.
- Parameters:
ar
- the request containing the section to allocatens
- the next section; use null to allow the next section to be automatically determined, if the next section is the last section, of if an extra section is being allocated- Returns:
- the allocated section or null if not successful
-
checkTurnoutStates
boolean checkTurnoutStates(Section s, int sSeqNum, Section nextSection, ActiveTrain at, Section prevSection) -
isMastHeldByDispatcher
-
checkBlocksNotInAllocatedSection
-
checkAutoRelease
Check if any allocation requests need to be allocated, or if any allocated sections need to be released -
releaseAllocatedSection
Releases an allocated Section, and removes it from the Dispatcher Input.- Parameters:
as
- the section to releaseterminatingTrain
- true if the associated train is being terminated; false otherwise
-
doReleaseAllocatedSection
-
sectionOccupancyChanged
Updates display when occupancy of an allocated section changes Also drives auto release if it is selected -
newFastClockMinute
Handle activity that is triggered by the fast clock -
isFastClockTimeGE
This method tests time- Parameters:
hr
- the hour to test against (0-23)min
- the minute to test against (0-59)- Returns:
- true if fast clock time and tested time are the same
-
getLayoutEditor
-
setLayoutEditor
-
getUseConnectivity
-
setUseConnectivity
-
setSignalType
-
getSignalType
-
getSignalTypeString
-
setStoppingSpeedName
-
getStoppingSpeedName
-
getMaximumLineSpeed
-
getTrainsFromRoster
-
setTrainsFromRoster
-
getTrainsFromTrains
-
setTrainsFromTrains
-
getTrainsFromUser
-
setTrainsFromUser
-
getAutoAllocate
-
getAutoRelease
-
stopStartAutoAllocateRelease
-
setAutoAllocate
-
setAutoRelease
-
getAutoTurnouts
-
setAutoTurnouts
-
getTrustKnownTurnouts
-
setTrustKnownTurnouts
-
getMinThrottleInterval
-
setMinThrottleInterval
-
getFullRampTime
-
setFullRampTime
-
getHasOccupancyDetection
-
setHasOccupancyDetection
-
getSetSSLDirectionalSensors
-
setSetSSLDirectionalSensors
-
getUseScaleMeters
-
setUseScaleMeters
-
getShortActiveTrainNames
-
setShortActiveTrainNames
-
getShortNameInBlock
-
setShortNameInBlock
-
getRosterEntryInBlock
-
setRosterEntryInBlock
-
getExtraColorForAllocated
-
setExtraColorForAllocated
-
getNameInAllocatedBlock
-
setNameInAllocatedBlock
-
getScale
-
setScale
-
getActiveTrainsList
-
getAllocatedSectionsList
-
getActiveTrainForRoster
-
getSupportVSDecoder
-
setSupportVSDecoder
-
newTrainDone
-
removeDelayedTrain
-
getAutoTrainsFrame
-
showTableHeaderPopup
Process the column header click- Parameters:
e
- the evnt datatable
- the JTable
-
addMouseListenerToHeader
Adds the column header pop listener to a JTable using XTableColumnModel- Parameters:
table
- The JTable effected.
-