Class DispatcherFrame
- All Implemented Interfaces:
ComponentListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants,BeanInterface,InstanceManagerAutoDefault,ModifiedFlag,WindowInterface
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassTable model for Active Trains Table in Dispatcher windowclassTable model for Allocated Section TableclassTable model for Allocation Request Table in Dispatcher windowprotected static class(package private) static class(package private) classClass to support Columnheader popup menu on XTableColum model.protected static enumNested classes/interfaces inherited from class jmri.util.JmriJFrame
JmriJFrame.ScreenDimensionsNested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyNested classes/interfaces inherited from interface jmri.util.swing.WindowInterface
WindowInterface.Hint -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<AllocatedSection>protected JmriJFramestatic boolean(package private) List<DispatcherFrame.HeldMastDetails>static final Stringstatic final StringConstants for the override typestatic final Stringstatic final Stringstatic final Stringstatic final intstatic final intstatic final intFields inherited from class jmri.util.JmriJFrame
allowInFrameServlet, properties, reuseFrameSavedPosition, reuseFrameSavedSized, windowInterfaceFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields 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_CURSORFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddDelayedTrain(ActiveTrain at, int restartType, Sensor delaySensor, boolean resetSensor) protected voidaddMouseListenerToHeader(JTable table) Adds the column header pop listener to a JTable using XTableColumnModelvoidvoid(package private) voidallocateNextRequested(int index) protected voidallocateSection(AllocationRequest ar, Section ns) Allocates a Section to an Active Train according to the information in an AllocationRequest.(package private) voidprotected voidCheck if any allocation requests need to be allocated, or if any allocated sections need to be releasedprotected Sectionprotected booleancheckForBlockInAllocatedSection(Block b, Section ignoreSection) Checks for a block in allocated section, except one(package private) List<LayoutTrackExpectedState<LayoutTurnout>>checkTurnoutStates(Section s, int sSeqNum, Section nextSection, ActiveTrain at, Section prevSection) 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 TransitcreateTemporaryTransit(Block start, Block dest, Block via) Converts a list ofLayoutBlockthat represent a route to a transit.voiddispose()When window is finally destroyed, remove it from the list of windows.protected voiddoReleaseAllocatedSection(AllocatedSection as, boolean terminatingTrain) booleanextendActiveTrainsPath(Section s, ActiveTrain at, JmriJFrame jFrame) Extend the allocation of a section to a active train.protected AllocationRequestfindAllocationRequestInQueue(Section s, int seq, int dir, ActiveTrain at) protected List<LayoutBlock>getAdHocRoute(Block start, Block dest, Block via) Get a list ofLayoutBlockthat represent a routeprotected List<AllocatedSection>protected booleanprotected booleanprotected booleanprotected AutoTurnoutsprotected booleanprotected intprotected booleanprotected LayoutEditorprotected floatprotected intprotected booleanbooleanprotected booleangetScale()getSectionName(Section sec) protected booleanprotected booleanprotected booleanprotected intprotected Stringprotected Stringprotected booleanprotected DispatcherFrame.TrainsFromprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanCheck an active train has an occupied section(package private) voidbooleanisAddressFree(int addr) Check DCC not already in usebooleanisFastClockTimeGE(int hr, int min) This method tests timebooleanprotected booleanisTrainFree(String rName) voidreads thru all the traininfo files found in the dispatcher directory and loads the ones flagged as "loadAtStartup".intloadTrainFromTrainInfo(String traininfoFileName) Loads a train into the Dispatcher from a traininfo fileintloadTrainFromTrainInfo(String traininfoFileName, String overRideType, String overRideValue) Loads a train into the Dispatcher from a traininfo file, overriding dccaddressintLoads a train into the DispatcherintloadTrainFromTrainInfo(TrainInfo info, String overRideType, String overRideValue) Loads a train into the Dispatcher returns an integer.voidloadTrainFromTrainInfoThrowsException(TrainInfo info, String overRideType, String overRideValue) Loads a train into the Dispatcher throws IllegalArgumentException on errorsprotected voidHandle activity that is triggered by the fast clockvoid(package private) voidprotected voidqueueAllocate(AllocationRequest aRequest) protected voidprotected voidqueueReleaseOfReservedSections(String trainName) protected voidprotected voidvoidreleaseAllocatedSection(AllocatedSection as, boolean terminatingTrain) Releases an allocated Section, and removes it from the Dispatcher Input.(package private) voidreleaseAllocatedSectionFromTable(int index) protected voidbooleanremoveFromActiveTrainPath(Section s, ActiveTrain at, JmriJFrame jFrame) protected booleanrequestAllocation(ActiveTrain activeTrain, Section section, int direction, int seqNumber, boolean showErrorMessages, JmriJFrame frame) protected booleanrequestAllocation(ActiveTrain activeTrain, Section section, int direction, int seqNumber, boolean showErrorMessages, JmriJFrame frame, boolean firstAllocation) Creates an Allocation Request, and registers it with DispatchervoidUpdates display when occupancy of an allocated section changes Also drives auto release if it is selectedprotected voidsetAutoAllocate(boolean set) protected voidsetAutoRelease(boolean set) protected voidsetAutoTurnouts(boolean set) protected voidsetExtraColorForAllocated(boolean set) protected voidsetFullRampTime(int set) protected voidsetHasOccupancyDetection(boolean set) protected voidsetLayoutEditor(LayoutEditor editor) protected voidsetMinThrottleInterval(int set) protected voidsetNameInAllocatedBlock(boolean set) voidsetNewTrainActive(boolean boo) protected voidsetRosterEntryInBlock(boolean set) protected voidprotected voidsetSetSSLDirectionalSensors(boolean set) protected voidsetShortActiveTrainNames(boolean set) protected voidsetShortNameInBlock(boolean set) protected voidsetSignalType(int type) protected voidsetStoppingSpeedName(String speedName) protected voidsetSupportVSDecoder(boolean set) protected voidprotected voidsetTrustKnownTurnouts(boolean set) protected voidsetUseConnectivity(boolean set) protected voidsetUseOccupiedTrackSpeed(boolean set) protected voidsetUseScaleMeters(boolean set) protected voidsetUseTurnoutConnectionDelay(boolean set) protected voidshowTableHeaderPopup(JmriMouseEvent e, JTable table) Process the column header clickprotected voidvoidterminateActiveTrain(ActiveTrain at, boolean terminateNow, boolean runNextTrain) Terminate an Active Train and remove it from the Dispatcher.(package private) voidMethods inherited from class jmri.util.JmriJFrame
addHelpMenu, componentHidden, componentMoved, componentResized, componentShown, generateWindowRef, getAllowInFrameServlet, getEscapeKeyAction, getEscapeKeyClosesWindow, getFrame, getFrame, getFrameList, getFrameList, getIndexedProperty, getMaximumSize, getModifiedFlag, getPreferredSize, getProperty, getPropertyNames, getSavePosition, getSaveSize, getScreenDimensions, getWindowFrameRef, getWindowInterface, handleModified, hasIndexedProperty, hasProperty, initComponents, makePrivateWindow, makePublicWindow, markWindowModified, multipleInstances, pack, setAllowInFrameServlet, setEscapeKeyAction, setEscapeKeyClosesWindow, setFrameLocation, setIndexedProperty, setModifiedFlag, setProperty, setSavePosition, setSaveSize, setShutDownTask, setWindowInterface, show, show, storeValues, undecorate, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpenedMethods 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, updateMethods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedMethods 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, toFrontMethods 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, validateTreeMethods 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
dispatcherSystemSchedulingInOperation
-
OVERRIDETYPE_NONE
Constants for the override type- See Also:
-
OVERRIDETYPE_USER
- See Also:
-
OVERRIDETYPE_DCCADDRESS
- See Also:
-
OVERRIDETYPE_OPERATIONS
- See Also:
-
OVERRIDETYPE_ROSTER
- See Also:
-
SIGNALHEAD
- See Also:
-
SIGNALMAST
- See Also:
-
SECTIONSALLOCATED
- See Also:
-
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". This is called as needed after the completion of file loading. -
dispose
Description copied from class:JmriJFrameWhen window is finally destroyed, remove it from the list of windows.Subclasses that over-ride this method must invoke this implementation with super.dispose() right before returning.
- Specified by:
disposein interfaceWindowInterface- Overrides:
disposein classJmriJFrame
-
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 returns an integer. Messages written to log.- Parameters:
info- a completed TrainInfo class.overRideType- "NONE", "USER", "ROSTER" or "OPERATIONS"overRideValue- "" , dccAddress, RosterEntryName or Operations trainName.- Returns:
- 0 good, -1 failure
-
loadTrainFromTrainInfoThrowsException
public void loadTrainFromTrainInfoThrowsException(TrainInfo info, String overRideType, String overRideValue) throws IllegalArgumentException Loads a train into the Dispatcher throws IllegalArgumentException on errors- Parameters:
info- a completed TrainInfo class.overRideType- "NONE", "USER", "ROSTER" or "OPERATIONS"overRideValue- "" , dccAddress, RosterEntryName or Operations trainName.- Throws:
IllegalArgumentException- validation errors.
-
getAdHocRoute
Get a list ofLayoutBlockthat represent a route- Parameters:
start- First Blockdest- Last Blockvia- Next Block- Returns:
- null if a route cannot be found, else the list.
-
createTemporaryTransit
Converts a list ofLayoutBlockthat represent a route to a transit.- Parameters:
start- First Blockdest- Last Blockvia- Next Block- Returns:
- null if the transit is valid. Else an AdHoc transit
-
getActiveTrainFrame
-
getNewTrainActive
-
setNewTrainActive
-
initializeOptions
void initializeOptions() -
openDispatcherWindow
void openDispatcherWindow() -
releaseAllocatedSectionFromTable
-
allocateExtraSection
-
queueScanOfAllocationRequests
-
queueReleaseOfReservedSections
-
queueAllocate
-
queueWaitForEmpty
-
queueReleaseOfCompletedAllocations
-
isTrainFree
-
isAddressFree
Check DCC not already in use- Parameters:
addr- DCC address.- Returns:
- true / false
-
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
-
allocateNextRequestedForTrain
-
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 terminateterminateNow- TRue if doing a full terminate, not just an end of transit.runNextTrain- if false the next traininfo is not run.
-
requestAllocation
protected boolean requestAllocation(ActiveTrain activeTrain, Section section, int direction, int seqNumber, boolean showErrorMessages, JmriJFrame frame, boolean firstAllocation) 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 windowfirstAllocation- True if first allocation- Returns:
- true if successful; false otherwise
-
requestAllocation
protected boolean requestAllocation(ActiveTrain activeTrain, Section section, int direction, int seqNumber, boolean showErrorMessages, JmriJFrame frame) -
findAllocationRequestInQueue
protected AllocationRequest findAllocationRequestInQueue(Section s, int seq, int dir, ActiveTrain at) -
addDelayedTrain
protected void addDelayedTrain(ActiveTrain at, int restartType, Sensor delaySensor, boolean resetSensor) -
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
-
hasTrainAnOccupiedSection
Check an active train has an occupied section- Parameters:
at- ActiveTRain object- Returns:
- true / false
-
checkTurnoutStates
List<LayoutTrackExpectedState<LayoutTurnout>> checkTurnoutStates(Section s, int sSeqNum, Section nextSection, ActiveTrain at, Section prevSection) - Parameters:
s- Section to checksSeqNum- Sequence number of sectionnextSection- section afterat- the active trainprevSection- the section before- Returns:
- null if error else a list of the turnouts and their expected states.
-
isMastHeldByDispatcher
-
checkForBlockInAllocatedSection
Checks for a block in allocated section, except one- Parameters:
b- - The BlockignoreSection- - ignore this section, can be null- Returns:
- true is The Block is being used in a section.
-
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
-
setTrainsFrom
-
getTrainsFrom
-
getAutoAllocate
-
getAutoRelease
-
stopStartAutoAllocateRelease
-
setAutoAllocate
-
setAutoRelease
-
getAutoTurnoutsHelper
-
getAutoTurnouts
-
setAutoTurnouts
-
getTrustKnownTurnouts
-
setTrustKnownTurnouts
-
getUseOccupiedTrackSpeed
-
setUseOccupiedTrackSpeed
-
getUseTurnoutConnectionDelay
-
setUseTurnoutConnectionDelay
-
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.
-