Class SpeedProfilePanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jmri.util.swing.JmriPanel
jmri.jmrit.roster.swing.speedprofile.SpeedProfilePanel
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,EventListener,Accessible,ThrottleListener
Set up and run automated speed table calibration.
Uses three sensors in a row (see diagram in window help):
- Start sensor: Track where locomotive starts
- Block sensor: Middle track. This time through this is used to measure the speed.
- Finish sensor: Track where locomotive stops before repeating.
- Start moving with Start sensor on, others off.
- Block (middle) sensor goes active: startListener calls startTiming
- Finish sensor goes active: finishListener calls stopCurrentSpeedStep
- Block (middle) sensor goes inactive: startListener calls stopLoco, which stops loco after 2.5 seconds
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static classNested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested 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.ThrottleListener
ThrottleListener.DecisionType -
Field Summary
FieldsModifier and TypeFieldDescription(package private) BeanSelectCreatePanel<Block>(package private) JButton(package private) JButton(package private) JButton(package private) PropertyChangeListener(package private) Sensor(package private) int(package private) long(package private) boolean(package private) JTextField(package private) SpeedProfilePanel.SensorDetails(package private) PropertyChangeListener(package private) Timer(package private) booleanprotected float(package private) JButtonprotected floatprotected floatprotected floatprotected floatprotected intprotected int(package private) RosterEntry(package private) RosterEntryComboBox(package private) JButton(package private) RosterSpeedProfile(package private) boolean(package private) JButton(package private) SpeedProfilePanel.SensorDetails(package private) BeanSelectCreatePanel<Sensor>(package private) SpeedProfilePanel.SensorDetails(package private) BeanSelectCreatePanel<Sensor>(package private) BeanSelectCreatePanel<Sensor>(package private) JTextField(package private) TreeMap<Integer,SpeedProfilePanel.SpeedStep> (package private) JTextField(package private) JTextField(package private) JTextField(package private) JTextField(package private) JTextField(package private) JTextField(package private) PropertyChangeListener(package private) Sensor(package private) long(package private) booleanprotected int(package private) DccThrottle(package private) SpeedProfileTable(package private) boolean(package private) JButton(package private) JButton(package private) float(package private) float(package private) boolean(package private) boolean(package private) JPanel(package private) JButton(package private) JButton(package private) JButton(package private) JButton(package private) JLabelstatic final Stringstatic final StringFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidaddRow(JPanel main, GridBagLayout gb, GridBagConstraints c, int row, Component left, Component right) (package private) void(package private) voidWe are canceling, release throttle, reset sensors.(package private) void(package private) static JPanelmakeLabelPanel(String text, Component comp) (package private) static JPanelmakePadPanel(Component comp) voidnotifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question) Profiling on a stolen or shared throttle is invalidvoidnotifyFailedThrottleRequest(LocoAddress address, String reason) Get notification that an attempt to request a throttle has failed.voidnotifyThrottleFound(DccThrottle _throttle) Get notification that a throttle has been found as requested.(package private) void(package private) voidsetButtonStates(boolean state) (package private) void(package private) booleanspeedStepNumOK(int num, String step) (package private) void(package private) void(package private) void(package private) voidstopLoco()(package private) void(package private) void(package private) voidMerge the new data into the existing speedprofile, or create if not current, and save.(package private) voidMerge the current profile with the new data in a temp area and show.(package private) voidView the new data collected we create a dummy entry and file with collected data(package private) voidView the current speedprofile table entrysMethods inherited from class jmri.util.swing.JmriPanel
dispose, getHelpTarget, getMenus, getMinimumDimension, getTitle, getWindowInterface, initComponents, initContext, isMultipleInstances, setWindowInterfaceMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
XML_ROOT
- See Also:
-
XML_NAMESPACE
- See Also:
-
profileButton
-
cancelButton
-
testButton
-
testCancelButton
-
clearNewDataButton
-
viewNewButton
-
viewMergedButton
-
viewButton
-
updateProfileButton
-
replaceProfileButton
-
deleteProfileButton
-
saveDefaultsButton
-
lengthField
-
sensorDelay
-
speedStepTest
-
speedStepTestFwd
-
speedStepTestRev
-
speedStepFrom
-
speedStepTo
-
speedStepIncr
-
warrentScaleLabel
-
sensorAPanel
-
sensorBPanel
-
blockCPanel
-
sensorCPanel
-
reBox
-
table
-
profile
boolean profile -
test
boolean test -
testSpeedFwd
float testSpeedFwd -
testSpeedRev
float testSpeedRev -
save
boolean save -
unmergedNewData
boolean unmergedNewData -
unsavedUpdatedProfile
boolean unsavedUpdatedProfile -
sensorA
-
sensorB
-
re
-
t
-
finishSpeedStep
int finishSpeedStep -
stepIncr
-
profileStep
-
profileSpeed
-
profileIncrement
-
profileSpeedStepMode
-
profileSensorDelay
-
profileBlockLength
-
rosterSpeedProfile
-
profileSpeedAtStart
-
overRunTimer
-
startListener
-
finishListener
-
middleListener
-
startSensor
-
finishSensor
-
middleBlockSensor
-
isForward
boolean isForward -
stepCalculated
boolean stepCalculated -
startTime
long startTime -
finishTime
long finishTime -
forwardOverRuns
-
reverseOverRuns
-
update
-
speeds
-
-
Constructor Details
-
SpeedProfilePanel
public SpeedProfilePanel()
-
-
Method Details
-
addRow
static void addRow(JPanel main, GridBagLayout gb, GridBagConstraints c, int row, Component left, Component right) -
makePadPanel
-
makeLabelPanel
-
setupProfile
void setupProfile() -
speedStepNumOK
-
notifyThrottleFound
Description copied from interface:ThrottleListenerGet notification that a throttle has been found as requested.- Specified by:
notifyThrottleFoundin interfaceThrottleListener- Parameters:
_throttle- the throttle with the requested address
-
setButtonStates
-
notifyFailedThrottleRequest
Description copied from interface:ThrottleListenerGet notification that an attempt to request a throttle has failed.- Specified by:
notifyFailedThrottleRequestin interfaceThrottleListener- Parameters:
address- address of the failed requestreason- failure cause
-
notifyDecisionRequired
Profiling on a stolen or shared throttle is invalidGet notification that a throttle request is in use by another device, and a "steal", "share", or "steal/share" decision may be required.
- Specified by:
notifyDecisionRequiredin interfaceThrottleListener- Parameters:
address- The LocoAddress that needs the decision.question- The question being asked, steal / cancel, share / cancel, steal / share / cancel
-
startProfile
void startProfile() -
startTiming
void startTiming() -
stopCurrentSpeedStep
void stopCurrentSpeedStep() -
stopLoco
void stopLoco() -
calculateSpeed
void calculateSpeed() -
updateSpeedProfileWithResults
Merge the new data into the existing speedprofile, or create if not current, and save. Clear new data. -
viewMergedData
void viewMergedData()Merge the current profile with the new data in a temp area and show. -
clearNewData
void clearNewData() -
removeSpeedProfile
void removeSpeedProfile() -
viewNewProfileData
void viewNewProfileData()View the new data collected we create a dummy entry and file with collected data -
viewRosterProfileData
void viewRosterProfileData()View the current speedprofile table entrys -
cancelButton
void cancelButton()We are canceling, release throttle, reset sensors. -
testButton
void testButton() -
stopTrainTest
void stopTrainTest()
-