Package jmri.jmrix.bachrus
Class SpeedoConsoleFrame
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- jmri.util.JmriJFrame
-
- jmri.jmrix.bachrus.SpeedoConsoleFrame
-
- All Implemented Interfaces:
java.awt.event.ComponentListener
,java.awt.event.WindowListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
,BeanInterface
,SpeedoListener
,ModifiedFlag
,ProgListener
,ThrottleListener
,WindowInterface
public class SpeedoConsoleFrame extends JmriJFrame implements SpeedoListener, ThrottleListener, ProgListener, java.beans.PropertyChangeListener
Frame for Speedo Console for Bachrus running stand reader interface- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SpeedoConsoleFrame.DisplayType
TODO: Complete the help fileprotected static class
SpeedoConsoleFrame.ProfileDirection
protected static class
SpeedoConsoleFrame.ProfileState
protected static class
SpeedoConsoleFrame.ProgState
-
Nested classes/interfaces inherited from class jmri.util.JmriJFrame
JmriJFrame.ScreenDimensions
-
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
-
Nested classes/interfaces inherited from interface jmri.ThrottleListener
ThrottleListener.DecisionType
-
Nested classes/interfaces inherited from interface jmri.util.swing.WindowInterface
WindowInterface.Hint
-
-
Field Summary
Fields Modifier and Type Field Description protected float
acc
protected javax.swing.JSpinner
accelerationField
protected javax.swing.JLabel
accelerationLabel
protected javax.swing.SpinnerNumberModel
accelerationSM
protected float
avSpeed
protected static int
BASIC
protected javax.swing.JRadioButton
basicESUSpeedMatchButton
protected javax.swing.JRadioButton
basicSimpleCVSpeedMatchButton
protected javax.swing.ButtonGroup
basicSpeedMatcherTypeGroup
protected javax.swing.JLabel
basicSpeedMatchInfo
protected javax.swing.JCheckBox
basicSpeedMatchReverseCheckbox
protected javax.swing.JButton
basicSpeedMatchStartStopButton
protected javax.swing.JSpinner
basicSpeedMatchTargetHighSpeedField
protected javax.swing.JLabel
basicSpeedMatchTargetHighSpeedLabel
protected javax.swing.JLabel
basicSpeedMatchTargetHighSpeedUnit
protected javax.swing.JSpinner
basicSpeedMatchTargetStartSpeedField
protected javax.swing.JLabel
basicSpeedMatchTargetStartSpeedLabel
protected javax.swing.JLabel
basicSpeedMatchTargetStartSpeedUnit
protected javax.swing.JCheckBox
basicSpeedMatchWarmUpCheckBox
protected javax.swing.JLabel
basicSpeedMatchWarmUpForwardLabel
protected javax.swing.JSpinner
basicSpeedMatchWarmUpForwardSeconds
protected javax.swing.SpinnerNumberModel
basicSpeedMatchWarmUpForwardSecondsSM
protected javax.swing.JLabel
basicSpeedMatchWarmUpForwardUnit
protected javax.swing.JLabel
basicSpeedMatchWarmUpReverseLabel
protected javax.swing.JSpinner
basicSpeedMatchWarmUpReverseSeconds
protected javax.swing.SpinnerNumberModel
basicSpeedMatchWarmUpReverseSecondsSM
protected javax.swing.JLabel
basicSpeedMatchWarmUpReverseUnit
protected javax.swing.JRadioButton
basicSpeedTableSpeedMatchButton
protected float
circ
protected static int
COMMAND
protected CommandStation
commandStation
protected float
count
protected float
currentSpeed
protected int
customScale
protected javax.swing.JTextField
customScaleField
protected javax.swing.JLabel
customScaleLabel
(package private) java.lang.String
customScalePref
protected int
dccServices
protected javax.swing.JSpinner
decelerationField
protected javax.swing.JLabel
decelerationLabel
protected javax.swing.SpinnerNumberModel
decelerationSM
protected static int
DEFAULT_SCALE
protected javax.swing.JRadioButton
dialButton
(package private) java.lang.String
dialTypePref
protected javax.swing.JCheckBox
dirFwdButton
protected javax.swing.JCheckBox
dirRevButton
protected SpeedoConsoleFrame.DisplayType
display
protected static int
DISPLAY_UPDATE
protected javax.swing.JPanel
displayCards
protected javax.swing.ButtonGroup
displayGroup
(package private) javax.swing.Timer
displayTimer
protected javax.swing.JButton
exportProfileButton
protected static int
FAST_DISPLAY_RATIO
(package private) javax.swing.Timer
fastDisplayTimer
(package private) static int[]
FILTER_LENGTH
protected float
freq
protected javax.swing.SpinnerNumberModel
highSpeedSM
protected float
incSpeed
protected javax.swing.JRadioButton
kphButton
protected javax.swing.JButton
loadProfileButton
protected javax.swing.JRadioButton
mphButton
protected javax.swing.JRadioButton
numButton
protected float
oldSpeed
(package private) UserPreferencesManager
prefs
protected javax.swing.JButton
printProfileButton
protected javax.swing.JTextField
printTitleText
protected SpeedoConsoleFrame.ProfileDirection
profileDir
(package private) GraphPane
profileGraphPane
protected float
profileSpeed
protected SpeedoConsoleFrame.ProfileState
profileState
protected int
profileStep
(package private) javax.swing.Timer
profileTimer
protected Programmer
prog
protected static int
PROG
protected SpeedoConsoleFrame.ProgState
progState
protected int
range
protected static int
RANGE1HI
protected static int
RANGE1LO
protected static int
RANGE2HI
protected static int
RANGE2LO
protected static int
RANGE3HI
protected static int
RANGE3LO
protected static int
RANGE4HI
protected static int
RANGE4LO
protected int
readAddress
protected javax.swing.JButton
readAddressButton
protected javax.swing.JLabel
readerLabel
protected javax.swing.JButton
readMomentumButton
(package private) javax.swing.Timer
replyTimer
protected javax.swing.JButton
resetGraphButton
protected RosterEntry
rosterEntry
protected float
sampleSpeed
protected javax.swing.JLabel
scaleLabel
(package private) javax.swing.JComboBox<java.lang.String>
scaleList
protected float[]
scales
protected java.lang.String[]
scaleStrings
protected float
selectedScale
(package private) java.lang.String
selectedScalePref
protected int
series
protected javax.swing.JButton
setMomentumButton
protected static int
SPEED_TEST_SCALE_FACTOR
protected javax.swing.ButtonGroup
speedGroup
protected SpeedMatcher
speedMatcher
protected SpeedoDial
speedoDialDisplay
protected javax.swing.JRadioButton
speedStepScaleESUSpeedMatchButton
protected javax.swing.JLabel
speedStepScaleMaxSpeedActualField
protected javax.swing.JLabel
speedStepScaleMaxSpeedActualLabel
protected javax.swing.JLabel
speedStepScaleMaxSpeedActualUnit
protected javax.swing.JLabel
speedStepScaleMaxSpeedTargetLabel
protected javax.swing.ButtonGroup
speedStepScaleSpeedMatcherTypeGroup
protected javax.swing.JLabel
speedStepScaleSpeedMatchInfo
protected javax.swing.JComboBox<SpeedTableStepSpeed>
speedStepScaleSpeedMatchMaxSpeedField
protected javax.swing.JLabel
speedStepScaleSpeedMatchMaxSpeedUnit
protected javax.swing.JCheckBox
speedStepScaleSpeedMatchReverseCheckbox
protected javax.swing.JButton
speedStepScaleSpeedMatchStartStopButton
protected javax.swing.JCheckBox
speedStepScaleSpeedMatchWarmUpCheckBox
protected javax.swing.JLabel
speedStepScaleSpeedMatchWarmUpForwardLabel
protected javax.swing.JSpinner
speedStepScaleSpeedMatchWarmUpForwardSeconds
protected javax.swing.SpinnerNumberModel
speedStepScaleSpeedMatchWarmUpForwardSecondsSM
protected javax.swing.JLabel
speedStepScaleSpeedMatchWarmUpForwardUnit
protected javax.swing.JLabel
speedStepScaleSpeedMatchWarmUpReverseLabel
protected javax.swing.JSpinner
speedStepScaleSpeedMatchWarmUpReverseSeconds
protected javax.swing.SpinnerNumberModel
speedStepScaleSpeedMatchWarmUpReverseSecondsSM
protected javax.swing.JLabel
speedStepScaleSpeedMatchWarmUpReverseUnit
protected javax.swing.JRadioButton
speedStepScaleSpeedTableSpeedMatchButton
protected javax.swing.JTextField
speedTextField
(package private) java.lang.String
speedUnitsKphPref
protected DccSpeedProfile
spFwd
protected DccSpeedProfile
spRef
protected DccSpeedProfile
spRev
protected javax.swing.JButton
startProfileButton
protected javax.swing.SpinnerNumberModel
startSpeedSM
protected javax.swing.JLabel
statusLabel
protected javax.swing.JButton
stopProfileButton
protected float
targetSpeed
(package private) SpeedoTrafficController
tc
protected DccThrottle
throttle
protected static int
THROTTLE
protected float
throttleIncrement
protected boolean
timerRunning
protected javax.swing.JCheckBox
toggleGridButton
protected javax.swing.JButton
trackPowerButton
-
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 jmri.ProgListener
CommError, ConfirmFailed, FailedTimeout, NoAck, NoLocoDetected, NotImplemented, OK, ProgrammerBusy, ProgrammingShort, SequenceError, UnknownError, UserAborted
-
-
Constructor Summary
Constructors Constructor Description SpeedoConsoleFrame(SpeedoSystemConnectionMemo memo)
Constructor for the SpeedoConsoleFrame
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
avClr()
Clears the average speed calculationprotected void
avFn(float speed)
Calculates the average speed using a filterprotected void
calcSpeed()
Calculates the scale speed in KPHprotected void
checkCustomScale()
Check if custom scale selected and enable the custom scale entry field.protected void
displayTimeout()
Internal routine to update the target speed for displayvoid
dispose()
Override for the JmriJFrame's dispose functionprotected void
fastDisplayTimeout()
Internal routine to update the displayed speedprotected void
getCustomScale()
Validate the users custom scale entry.void
initComponents()
Override for the JmriJFrame's initComponents functionvoid
notifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)
Called when we must decide to steal the throttle for the requested address.void
notifyFailedThrottleRequest(LocoAddress address, java.lang.String reason)
Called when a throttle could not be obtainedvoid
notifyThrottleFound(DccThrottle t)
Called when a throttle is foundprotected void
profileTimeout()
Profile timer timeout handlervoid
programmingOpReply(int value, int status)
Called when the programmer (ops mode or service mode) has completed its operationvoid
propertyChange(java.beans.PropertyChangeEvent evt)
protected void
readAddress()
Starts reading the address (CVs 29 then 1 (short) or 17 and 18 (long)) using the service mode programmerprotected void
readMomentum()
Starts reading the momentum CVs (CV 3 and 4) using the global programmervoid
reply(SpeedoReply l)
Handle "replies" from the hardware.protected void
replyTimeout()
Internal routine to reset the speed on a timeout.protected void
setDial()
Set the speed to be displayed as a dial or numericprotected void
setMomentum()
Starts writing the momentum CVs (CV 3 and 4) using the global programmervoid
setRosterEntry(RosterEntry entry)
Set the RosterEntry for this throttle.protected void
setUnits()
Set the displays to mile per hour or kilometers per hourprotected void
showSpeed()
Displays the speed in the SpeedoConsoleFrame's digital/analog speedometerprotected void
startDisplayTimer()
Starts the timer used to update the speedometer display speed.protected void
startFastDisplayTimer()
Starts the timer used to update the speedometer display speed at a faster rate.protected void
startProfile()
Start the speed profiling processprotected void
startRead(java.lang.String cv)
Starts reading a CV using the service mode programmerprotected void
startReplyTimer()
Starts the speedo hardware reply timer.protected void
startWrite(java.lang.String cv, int value)
STarts writing a CV using the global programmerprotected void
stopProfileAndSpeedMatch()
Stops the profiling and speed matching processes.protected void
stopTimers()
Stops profile and speed match timersprotected void
switchRange()
Switches the filter used for averaging speed based on the measured speedprotected void
throttleTimeout()
Timeout requesting a throttle.protected void
tidyUp()
Resets profiling and speed matching timers and other pertinent values and releases the throttle and ops mode programmerprotected java.lang.String
title()
Grabs the title for the SpeedoConsoleFrameprotected void
trackPower()
Called when the track power button is clicked to turn on or off track power Allows user to power up and give time for sound decoder startup sequence before running a profile-
Methods 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, 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
addNotify, 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 Detail
-
scaleLabel
protected javax.swing.JLabel scaleLabel
-
customScaleLabel
protected javax.swing.JLabel customScaleLabel
-
customScaleField
protected javax.swing.JTextField customScaleField
-
customScale
protected int customScale
-
speedTextField
protected javax.swing.JTextField speedTextField
-
displayCards
protected javax.swing.JPanel displayCards
-
speedGroup
protected javax.swing.ButtonGroup speedGroup
-
mphButton
protected javax.swing.JRadioButton mphButton
-
kphButton
protected javax.swing.JRadioButton kphButton
-
displayGroup
protected javax.swing.ButtonGroup displayGroup
-
numButton
protected javax.swing.JRadioButton numButton
-
dialButton
protected javax.swing.JRadioButton dialButton
-
speedoDialDisplay
protected SpeedoDial speedoDialDisplay
-
dirFwdButton
protected javax.swing.JCheckBox dirFwdButton
-
dirRevButton
protected javax.swing.JCheckBox dirRevButton
-
toggleGridButton
protected javax.swing.JCheckBox toggleGridButton
-
statusLabel
protected javax.swing.JLabel statusLabel
-
readerLabel
protected javax.swing.JLabel readerLabel
-
DEFAULT_SCALE
protected static final int DEFAULT_SCALE
- See Also:
- Constant Field Values
-
selectedScale
protected float selectedScale
-
series
protected int series
-
sampleSpeed
protected float sampleSpeed
-
targetSpeed
protected float targetSpeed
-
currentSpeed
protected float currentSpeed
-
incSpeed
protected float incSpeed
-
oldSpeed
protected float oldSpeed
-
acc
protected float acc
-
avSpeed
protected float avSpeed
-
range
protected int range
-
circ
protected float circ
-
count
protected float count
-
freq
protected float freq
-
DISPLAY_UPDATE
protected static final int DISPLAY_UPDATE
- See Also:
- Constant Field Values
-
FAST_DISPLAY_RATIO
protected static final int FAST_DISPLAY_RATIO
- See Also:
- Constant Field Values
-
RANGE1LO
protected static final int RANGE1LO
- See Also:
- Constant Field Values
-
RANGE1HI
protected static final int RANGE1HI
- See Also:
- Constant Field Values
-
RANGE2LO
protected static final int RANGE2LO
- See Also:
- Constant Field Values
-
RANGE2HI
protected static final int RANGE2HI
- See Also:
- Constant Field Values
-
RANGE3LO
protected static final int RANGE3LO
- See Also:
- Constant Field Values
-
RANGE3HI
protected static final int RANGE3HI
- See Also:
- Constant Field Values
-
RANGE4LO
protected static final int RANGE4LO
- See Also:
- Constant Field Values
-
RANGE4HI
protected static final int RANGE4HI
- See Also:
- Constant Field Values
-
FILTER_LENGTH
static final int[] FILTER_LENGTH
-
selectedScalePref
java.lang.String selectedScalePref
-
customScalePref
java.lang.String customScalePref
-
speedUnitsKphPref
java.lang.String speedUnitsKphPref
-
dialTypePref
java.lang.String dialTypePref
-
prefs
UserPreferencesManager prefs
-
scaleStrings
protected java.lang.String[] scaleStrings
-
scales
protected float[] scales
-
scaleList
javax.swing.JComboBox<java.lang.String> scaleList
-
display
protected SpeedoConsoleFrame.DisplayType display
-
dccServices
protected int dccServices
-
BASIC
protected static final int BASIC
- See Also:
- Constant Field Values
-
PROG
protected static final int PROG
- See Also:
- Constant Field Values
-
COMMAND
protected static final int COMMAND
- See Also:
- Constant Field Values
-
THROTTLE
protected static final int THROTTLE
- See Also:
- Constant Field Values
-
timerRunning
protected boolean timerRunning
-
progState
protected SpeedoConsoleFrame.ProgState progState
-
throttleIncrement
protected float throttleIncrement
-
prog
protected Programmer prog
-
commandStation
protected CommandStation commandStation
-
readAddressButton
protected javax.swing.JButton readAddressButton
-
rosterEntry
protected RosterEntry rosterEntry
-
readAddress
protected int readAddress
-
accelerationSM
protected javax.swing.SpinnerNumberModel accelerationSM
-
decelerationSM
protected javax.swing.SpinnerNumberModel decelerationSM
-
accelerationLabel
protected javax.swing.JLabel accelerationLabel
-
accelerationField
protected javax.swing.JSpinner accelerationField
-
decelerationLabel
protected javax.swing.JLabel decelerationLabel
-
decelerationField
protected javax.swing.JSpinner decelerationField
-
readMomentumButton
protected javax.swing.JButton readMomentumButton
-
setMomentumButton
protected javax.swing.JButton setMomentumButton
-
trackPowerButton
protected javax.swing.JButton trackPowerButton
-
startProfileButton
protected javax.swing.JButton startProfileButton
-
stopProfileButton
protected javax.swing.JButton stopProfileButton
-
exportProfileButton
protected javax.swing.JButton exportProfileButton
-
printProfileButton
protected javax.swing.JButton printProfileButton
-
resetGraphButton
protected javax.swing.JButton resetGraphButton
-
loadProfileButton
protected javax.swing.JButton loadProfileButton
-
printTitleText
protected javax.swing.JTextField printTitleText
-
profileGraphPane
GraphPane profileGraphPane
-
spFwd
protected DccSpeedProfile spFwd
-
spRev
protected DccSpeedProfile spRev
-
spRef
protected DccSpeedProfile spRef
-
profileDir
protected SpeedoConsoleFrame.ProfileDirection profileDir
-
throttle
protected DccThrottle throttle
-
profileStep
protected int profileStep
-
profileSpeed
protected float profileSpeed
-
profileState
protected SpeedoConsoleFrame.ProfileState profileState
-
basicSpeedMatchInfo
protected javax.swing.JLabel basicSpeedMatchInfo
-
basicSpeedMatcherTypeGroup
protected javax.swing.ButtonGroup basicSpeedMatcherTypeGroup
-
basicSimpleCVSpeedMatchButton
protected javax.swing.JRadioButton basicSimpleCVSpeedMatchButton
-
basicSpeedTableSpeedMatchButton
protected javax.swing.JRadioButton basicSpeedTableSpeedMatchButton
-
basicESUSpeedMatchButton
protected javax.swing.JRadioButton basicESUSpeedMatchButton
-
basicSpeedMatchWarmUpForwardSecondsSM
protected javax.swing.SpinnerNumberModel basicSpeedMatchWarmUpForwardSecondsSM
-
basicSpeedMatchWarmUpReverseSecondsSM
protected javax.swing.SpinnerNumberModel basicSpeedMatchWarmUpReverseSecondsSM
-
basicSpeedMatchReverseCheckbox
protected javax.swing.JCheckBox basicSpeedMatchReverseCheckbox
-
basicSpeedMatchWarmUpCheckBox
protected javax.swing.JCheckBox basicSpeedMatchWarmUpCheckBox
-
basicSpeedMatchWarmUpForwardLabel
protected javax.swing.JLabel basicSpeedMatchWarmUpForwardLabel
-
basicSpeedMatchWarmUpForwardSeconds
protected javax.swing.JSpinner basicSpeedMatchWarmUpForwardSeconds
-
basicSpeedMatchWarmUpForwardUnit
protected javax.swing.JLabel basicSpeedMatchWarmUpForwardUnit
-
basicSpeedMatchWarmUpReverseLabel
protected javax.swing.JLabel basicSpeedMatchWarmUpReverseLabel
-
basicSpeedMatchWarmUpReverseSeconds
protected javax.swing.JSpinner basicSpeedMatchWarmUpReverseSeconds
-
basicSpeedMatchWarmUpReverseUnit
protected javax.swing.JLabel basicSpeedMatchWarmUpReverseUnit
-
basicSpeedMatchTargetStartSpeedLabel
protected javax.swing.JLabel basicSpeedMatchTargetStartSpeedLabel
-
startSpeedSM
protected javax.swing.SpinnerNumberModel startSpeedSM
-
basicSpeedMatchTargetStartSpeedField
protected javax.swing.JSpinner basicSpeedMatchTargetStartSpeedField
-
basicSpeedMatchTargetStartSpeedUnit
protected javax.swing.JLabel basicSpeedMatchTargetStartSpeedUnit
-
basicSpeedMatchTargetHighSpeedLabel
protected javax.swing.JLabel basicSpeedMatchTargetHighSpeedLabel
-
highSpeedSM
protected javax.swing.SpinnerNumberModel highSpeedSM
-
basicSpeedMatchTargetHighSpeedField
protected javax.swing.JSpinner basicSpeedMatchTargetHighSpeedField
-
basicSpeedMatchTargetHighSpeedUnit
protected javax.swing.JLabel basicSpeedMatchTargetHighSpeedUnit
-
basicSpeedMatchStartStopButton
protected javax.swing.JButton basicSpeedMatchStartStopButton
-
speedStepScaleSpeedMatchInfo
protected javax.swing.JLabel speedStepScaleSpeedMatchInfo
-
speedStepScaleSpeedMatcherTypeGroup
protected javax.swing.ButtonGroup speedStepScaleSpeedMatcherTypeGroup
-
speedStepScaleSpeedTableSpeedMatchButton
protected javax.swing.JRadioButton speedStepScaleSpeedTableSpeedMatchButton
-
speedStepScaleESUSpeedMatchButton
protected javax.swing.JRadioButton speedStepScaleESUSpeedMatchButton
-
speedStepScaleSpeedMatchWarmUpForwardSecondsSM
protected javax.swing.SpinnerNumberModel speedStepScaleSpeedMatchWarmUpForwardSecondsSM
-
speedStepScaleSpeedMatchWarmUpReverseSecondsSM
protected javax.swing.SpinnerNumberModel speedStepScaleSpeedMatchWarmUpReverseSecondsSM
-
speedStepScaleSpeedMatchReverseCheckbox
protected javax.swing.JCheckBox speedStepScaleSpeedMatchReverseCheckbox
-
speedStepScaleSpeedMatchWarmUpCheckBox
protected javax.swing.JCheckBox speedStepScaleSpeedMatchWarmUpCheckBox
-
speedStepScaleSpeedMatchWarmUpForwardLabel
protected javax.swing.JLabel speedStepScaleSpeedMatchWarmUpForwardLabel
-
speedStepScaleSpeedMatchWarmUpForwardSeconds
protected javax.swing.JSpinner speedStepScaleSpeedMatchWarmUpForwardSeconds
-
speedStepScaleSpeedMatchWarmUpForwardUnit
protected javax.swing.JLabel speedStepScaleSpeedMatchWarmUpForwardUnit
-
speedStepScaleSpeedMatchWarmUpReverseLabel
protected javax.swing.JLabel speedStepScaleSpeedMatchWarmUpReverseLabel
-
speedStepScaleSpeedMatchWarmUpReverseSeconds
protected javax.swing.JSpinner speedStepScaleSpeedMatchWarmUpReverseSeconds
-
speedStepScaleSpeedMatchWarmUpReverseUnit
protected javax.swing.JLabel speedStepScaleSpeedMatchWarmUpReverseUnit
-
speedStepScaleMaxSpeedTargetLabel
protected javax.swing.JLabel speedStepScaleMaxSpeedTargetLabel
-
speedStepScaleSpeedMatchMaxSpeedField
protected javax.swing.JComboBox<SpeedTableStepSpeed> speedStepScaleSpeedMatchMaxSpeedField
-
speedStepScaleSpeedMatchMaxSpeedUnit
protected javax.swing.JLabel speedStepScaleSpeedMatchMaxSpeedUnit
-
speedStepScaleSpeedMatchStartStopButton
protected javax.swing.JButton speedStepScaleSpeedMatchStartStopButton
-
speedStepScaleMaxSpeedActualLabel
protected javax.swing.JLabel speedStepScaleMaxSpeedActualLabel
-
speedStepScaleMaxSpeedActualField
protected javax.swing.JLabel speedStepScaleMaxSpeedActualField
-
speedStepScaleMaxSpeedActualUnit
protected javax.swing.JLabel speedStepScaleMaxSpeedActualUnit
-
speedMatcher
protected SpeedMatcher speedMatcher
-
SPEED_TEST_SCALE_FACTOR
protected static final int SPEED_TEST_SCALE_FACTOR
- See Also:
- Constant Field Values
-
profileTimer
javax.swing.Timer profileTimer
-
replyTimer
javax.swing.Timer replyTimer
-
displayTimer
javax.swing.Timer displayTimer
-
fastDisplayTimer
javax.swing.Timer fastDisplayTimer
-
-
Constructor Detail
-
SpeedoConsoleFrame
public SpeedoConsoleFrame(SpeedoSystemConnectionMemo memo)
Constructor for the SpeedoConsoleFrame- Parameters:
memo
- the memo for the connection the Speedo is using
-
-
Method Detail
-
title
protected java.lang.String title()
Grabs the title for the SpeedoConsoleFrame- Returns:
- the frame's title
-
dispose
public void dispose()
Override for the JmriJFrame's dispose function- Specified by:
dispose
in interfaceWindowInterface
- Overrides:
dispose
in classJmriJFrame
-
initComponents
public void initComponents()
Override for the JmriJFrame's initComponents function- Overrides:
initComponents
in classJmriJFrame
-
reply
public void reply(SpeedoReply l)
Handle "replies" from the hardware. In fact, all the hardware does is send a constant stream of unsolicited speed updates.- Specified by:
reply
in interfaceSpeedoListener
- Parameters:
l
- the reply to handle
-
calcSpeed
protected void calcSpeed()
Calculates the scale speed in KPH
-
avFn
protected void avFn(float speed)
Calculates the average speed using a filter- Parameters:
speed
- the speed of the latest interation
-
avClr
protected void avClr()
Clears the average speed calculation
-
switchRange
protected void switchRange()
Switches the filter used for averaging speed based on the measured speed
-
showSpeed
protected void showSpeed()
Displays the speed in the SpeedoConsoleFrame's digital/analog speedometer
-
checkCustomScale
protected void checkCustomScale()
Check if custom scale selected and enable the custom scale entry field.
-
setDial
protected void setDial()
Set the speed to be displayed as a dial or numeric
-
setUnits
protected void setUnits()
Set the displays to mile per hour or kilometers per hour
-
getCustomScale
protected void getCustomScale()
Validate the users custom scale entry.
-
setRosterEntry
public void setRosterEntry(RosterEntry entry)
Set the RosterEntry for this throttle.- Parameters:
entry
- roster entry selected for throttle
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
Handles property changes from the power manager.
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
trackPower
protected void trackPower()
Called when the track power button is clicked to turn on or off track power Allows user to power up and give time for sound decoder startup sequence before running a profile
-
startProfile
protected void startProfile()
Start the speed profiling process
-
profileTimeout
protected void profileTimeout()
Profile timer timeout handler
-
tidyUp
protected void tidyUp()
Resets profiling and speed matching timers and other pertinent values and releases the throttle and ops mode programmerCalled both when profiling or speed matching finish successfully or error out
-
stopProfileAndSpeedMatch
protected void stopProfileAndSpeedMatch()
Stops the profiling and speed matching processes. Called by pressing either the stop profile or stop speed matching buttons.
-
stopTimers
protected void stopTimers()
Stops profile and speed match timers
-
notifyThrottleFound
public void notifyThrottleFound(DccThrottle t)
Called when a throttle is found- Specified by:
notifyThrottleFound
in interfaceThrottleListener
- Parameters:
t
- the requested DccThrottle
-
notifyFailedThrottleRequest
public void notifyFailedThrottleRequest(LocoAddress address, java.lang.String reason)
Called when a throttle could not be obtained- Specified by:
notifyFailedThrottleRequest
in interfaceThrottleListener
- Parameters:
address
- the requested addressreason
- the reason the throttle could not be obtained
-
notifyDecisionRequired
public void notifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)
Called when we must decide to steal the throttle for the requested address. Since this is a an automatically stealing implementation, the throttle will be automatically stolen.- Specified by:
notifyDecisionRequired
in interfaceThrottleListener
- Parameters:
address
- The LocoAddress that needs the decision.question
- The question being asked, steal / cancel, share / cancel, steal / share / cancel
-
startReplyTimer
protected void startReplyTimer()
Starts the speedo hardware reply timer. Once we receive a speedoReply we expect them regularly, at least once every 4 seconds.
-
startDisplayTimer
protected void startDisplayTimer()
Starts the timer used to update the speedometer display speed.
-
startFastDisplayTimer
protected void startFastDisplayTimer()
Starts the timer used to update the speedometer display speed at a faster rate.
-
replyTimeout
protected void replyTimeout()
Internal routine to reset the speed on a timeout.
-
displayTimeout
protected void displayTimeout()
Internal routine to update the target speed for display
-
fastDisplayTimeout
protected void fastDisplayTimeout()
Internal routine to update the displayed speed
-
throttleTimeout
protected void throttleTimeout()
Timeout requesting a throttle.
-
readAddress
protected void readAddress()
Starts reading the address (CVs 29 then 1 (short) or 17 and 18 (long)) using the service mode programmer
-
readMomentum
protected void readMomentum()
Starts reading the momentum CVs (CV 3 and 4) using the global programmer
-
setMomentum
protected void setMomentum()
Starts writing the momentum CVs (CV 3 and 4) using the global programmer
-
startRead
protected void startRead(java.lang.String cv)
Starts reading a CV using the service mode programmer- Parameters:
cv
- the CV
-
startWrite
protected void startWrite(java.lang.String cv, int value)
STarts writing a CV using the global programmer- Parameters:
cv
- the CVvalue
- the value to write to the CV
-
programmingOpReply
public void programmingOpReply(int value, int status)
Called when the programmer (ops mode or service mode) has completed its operation- Specified by:
programmingOpReply
in interfaceProgListener
- Parameters:
value
- Value from a read operation, or value written on a writestatus
- Denotes the completion code. Note that this is a bitwise combination of the various states codes defined in this interface. (see ProgListener.java for possible values)
-
-