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 classSpeedoConsoleFrame.DisplayTypeTODO: Complete the help fileprotected static classSpeedoConsoleFrame.ProfileDirectionprotected static classSpeedoConsoleFrame.ProfileStateprotected static classSpeedoConsoleFrame.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 floataccprotected javax.swing.JSpinneraccelerationFieldprotected javax.swing.JLabelaccelerationLabelprotected javax.swing.SpinnerNumberModelaccelerationSMprotected floatavSpeedprotected static intBASICprotected javax.swing.JRadioButtonbasicESUSpeedMatchButtonprotected javax.swing.JRadioButtonbasicSimpleCVSpeedMatchButtonprotected javax.swing.ButtonGroupbasicSpeedMatcherTypeGroupprotected javax.swing.JLabelbasicSpeedMatchInfoprotected javax.swing.JCheckBoxbasicSpeedMatchReverseCheckboxprotected javax.swing.JButtonbasicSpeedMatchStartStopButtonprotected javax.swing.JSpinnerbasicSpeedMatchTargetHighSpeedFieldprotected javax.swing.JLabelbasicSpeedMatchTargetHighSpeedLabelprotected javax.swing.JLabelbasicSpeedMatchTargetHighSpeedUnitprotected javax.swing.JSpinnerbasicSpeedMatchTargetStartSpeedFieldprotected javax.swing.JLabelbasicSpeedMatchTargetStartSpeedLabelprotected javax.swing.JLabelbasicSpeedMatchTargetStartSpeedUnitprotected javax.swing.JCheckBoxbasicSpeedMatchWarmUpCheckBoxprotected javax.swing.JLabelbasicSpeedMatchWarmUpForwardLabelprotected javax.swing.JSpinnerbasicSpeedMatchWarmUpForwardSecondsprotected javax.swing.SpinnerNumberModelbasicSpeedMatchWarmUpForwardSecondsSMprotected javax.swing.JLabelbasicSpeedMatchWarmUpForwardUnitprotected javax.swing.JLabelbasicSpeedMatchWarmUpReverseLabelprotected javax.swing.JSpinnerbasicSpeedMatchWarmUpReverseSecondsprotected javax.swing.SpinnerNumberModelbasicSpeedMatchWarmUpReverseSecondsSMprotected javax.swing.JLabelbasicSpeedMatchWarmUpReverseUnitprotected javax.swing.JRadioButtonbasicSpeedTableSpeedMatchButtonprotected floatcircprotected static intCOMMANDprotected CommandStationcommandStationprotected floatcountprotected floatcurrentSpeedprotected intcustomScaleprotected javax.swing.JTextFieldcustomScaleFieldprotected javax.swing.JLabelcustomScaleLabel(package private) java.lang.StringcustomScalePrefprotected intdccServicesprotected javax.swing.JSpinnerdecelerationFieldprotected javax.swing.JLabeldecelerationLabelprotected javax.swing.SpinnerNumberModeldecelerationSMprotected static intDEFAULT_SCALEprotected javax.swing.JRadioButtondialButton(package private) java.lang.StringdialTypePrefprotected javax.swing.JCheckBoxdirFwdButtonprotected javax.swing.JCheckBoxdirRevButtonprotected SpeedoConsoleFrame.DisplayTypedisplayprotected static intDISPLAY_UPDATEprotected javax.swing.JPaneldisplayCardsprotected javax.swing.ButtonGroupdisplayGroup(package private) javax.swing.TimerdisplayTimerprotected javax.swing.JButtonexportProfileButtonprotected static intFAST_DISPLAY_RATIO(package private) javax.swing.TimerfastDisplayTimer(package private) static int[]FILTER_LENGTHprotected floatfreqprotected javax.swing.SpinnerNumberModelhighSpeedSMprotected floatincSpeedprotected javax.swing.JRadioButtonkphButtonprotected javax.swing.JButtonloadProfileButtonprotected javax.swing.JRadioButtonmphButtonprotected javax.swing.JRadioButtonnumButtonprotected floatoldSpeed(package private) UserPreferencesManagerprefsprotected javax.swing.JButtonprintProfileButtonprotected javax.swing.JTextFieldprintTitleTextprotected SpeedoConsoleFrame.ProfileDirectionprofileDir(package private) GraphPaneprofileGraphPaneprotected floatprofileSpeedprotected SpeedoConsoleFrame.ProfileStateprofileStateprotected intprofileStep(package private) javax.swing.TimerprofileTimerprotected Programmerprogprotected static intPROGprotected SpeedoConsoleFrame.ProgStateprogStateprotected intrangeprotected static intRANGE1HIprotected static intRANGE1LOprotected static intRANGE2HIprotected static intRANGE2LOprotected static intRANGE3HIprotected static intRANGE3LOprotected static intRANGE4HIprotected static intRANGE4LOprotected intreadAddressprotected javax.swing.JButtonreadAddressButtonprotected javax.swing.JLabelreaderLabelprotected javax.swing.JButtonreadMomentumButton(package private) javax.swing.TimerreplyTimerprotected javax.swing.JButtonresetGraphButtonprotected RosterEntryrosterEntryprotected floatsampleSpeedprotected javax.swing.JLabelscaleLabel(package private) javax.swing.JComboBox<java.lang.String>scaleListprotected float[]scalesprotected java.lang.String[]scaleStringsprotected floatselectedScale(package private) java.lang.StringselectedScalePrefprotected intseriesprotected javax.swing.JButtonsetMomentumButtonprotected static intSPEED_TEST_SCALE_FACTORprotected javax.swing.ButtonGroupspeedGroupprotected SpeedMatcherspeedMatcherprotected SpeedoDialspeedoDialDisplayprotected javax.swing.JRadioButtonspeedStepScaleESUSpeedMatchButtonprotected javax.swing.JLabelspeedStepScaleMaxSpeedActualFieldprotected javax.swing.JLabelspeedStepScaleMaxSpeedActualLabelprotected javax.swing.JLabelspeedStepScaleMaxSpeedActualUnitprotected javax.swing.JLabelspeedStepScaleMaxSpeedTargetLabelprotected javax.swing.ButtonGroupspeedStepScaleSpeedMatcherTypeGroupprotected javax.swing.JLabelspeedStepScaleSpeedMatchInfoprotected javax.swing.JLabelspeedStepScaleSpeedMatchMaxSpeedUnitprotected javax.swing.JCheckBoxspeedStepScaleSpeedMatchReverseCheckboxprotected javax.swing.JButtonspeedStepScaleSpeedMatchStartStopButtonprotected javax.swing.JCheckBoxspeedStepScaleSpeedMatchWarmUpCheckBoxprotected javax.swing.JLabelspeedStepScaleSpeedMatchWarmUpForwardLabelprotected javax.swing.JSpinnerspeedStepScaleSpeedMatchWarmUpForwardSecondsprotected javax.swing.SpinnerNumberModelspeedStepScaleSpeedMatchWarmUpForwardSecondsSMprotected javax.swing.JLabelspeedStepScaleSpeedMatchWarmUpForwardUnitprotected javax.swing.JLabelspeedStepScaleSpeedMatchWarmUpReverseLabelprotected javax.swing.JSpinnerspeedStepScaleSpeedMatchWarmUpReverseSecondsprotected javax.swing.SpinnerNumberModelspeedStepScaleSpeedMatchWarmUpReverseSecondsSMprotected javax.swing.JLabelspeedStepScaleSpeedMatchWarmUpReverseUnitprotected javax.swing.JRadioButtonspeedStepScaleSpeedTableSpeedMatchButtonprotected javax.swing.JTextFieldspeedTextField(package private) java.lang.StringspeedUnitsKphPrefprotected DccSpeedProfilespFwdprotected DccSpeedProfilespRefprotected DccSpeedProfilespRevprotected javax.swing.JButtonstartProfileButtonprotected javax.swing.SpinnerNumberModelstartSpeedSMprotected javax.swing.JLabelstatusLabelprotected javax.swing.JButtonstopProfileButtonprotected floattargetSpeed(package private) SpeedoTrafficControllertcprotected DccThrottlethrottleprotected static intTHROTTLEprotected floatthrottleIncrementprotected booleantimerRunningprotected javax.swing.JCheckBoxtoggleGridButtonprotected javax.swing.JButtontrackPowerButton-
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 voidavClr()Clears the average speed calculationprotected voidavFn(float speed)Calculates the average speed using a filterprotected voidcalcSpeed()Calculates the scale speed in KPHprotected voidcheckCustomScale()Check if custom scale selected and enable the custom scale entry field.protected voiddisplayTimeout()Internal routine to update the target speed for displayvoiddispose()Override for the JmriJFrame's dispose functionprotected voidfastDisplayTimeout()Internal routine to update the displayed speedprotected voidgetCustomScale()Validate the users custom scale entry.voidinitComponents()Override for the JmriJFrame's initComponents functionvoidnotifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)Called when we must decide to steal the throttle for the requested address.voidnotifyFailedThrottleRequest(LocoAddress address, java.lang.String reason)Called when a throttle could not be obtainedvoidnotifyThrottleFound(DccThrottle t)Called when a throttle is foundprotected voidprofileTimeout()Profile timer timeout handlervoidprogrammingOpReply(int value, int status)Called when the programmer (ops mode or service mode) has completed its operationvoidpropertyChange(java.beans.PropertyChangeEvent evt)protected voidreadAddress()Starts reading the address (CVs 29 then 1 (short) or 17 and 18 (long)) using the service mode programmerprotected voidreadMomentum()Starts reading the momentum CVs (CV 3 and 4) using the global programmervoidreply(SpeedoReply l)Handle "replies" from the hardware.protected voidreplyTimeout()Internal routine to reset the speed on a timeout.protected voidsetDial()Set the speed to be displayed as a dial or numericprotected voidsetMomentum()Starts writing the momentum CVs (CV 3 and 4) using the global programmervoidsetRosterEntry(RosterEntry entry)Set the RosterEntry for this throttle.protected voidsetUnits()Set the displays to mile per hour or kilometers per hourprotected voidshowSpeed()Displays the speed in the SpeedoConsoleFrame's digital/analog speedometerprotected voidstartDisplayTimer()Starts the timer used to update the speedometer display speed.protected voidstartFastDisplayTimer()Starts the timer used to update the speedometer display speed at a faster rate.protected voidstartProfile()Start the speed profiling processprotected voidstartRead(java.lang.String cv)Starts reading a CV using the service mode programmerprotected voidstartReplyTimer()Starts the speedo hardware reply timer.protected voidstartWrite(java.lang.String cv, int value)STarts writing a CV using the global programmerprotected voidstopProfileAndSpeedMatch()Stops the profiling and speed matching processes.protected voidstopTimers()Stops profile and speed match timersprotected voidswitchRange()Switches the filter used for averaging speed based on the measured speedprotected voidthrottleTimeout()Timeout requesting a throttle.protected voidtidyUp()Resets profiling and speed matching timers and other pertinent values and releases the throttle and ops mode programmerprotected java.lang.Stringtitle()Grabs the title for the SpeedoConsoleFrameprotected voidtrackPower()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, 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, 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
-
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:
disposein interfaceWindowInterface- Overrides:
disposein classJmriJFrame
-
initComponents
public void initComponents()
Override for the JmriJFrame's initComponents function- Overrides:
initComponentsin 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:
replyin 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:
propertyChangein 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:
notifyThrottleFoundin 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:
notifyFailedThrottleRequestin 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:
notifyDecisionRequiredin 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:
programmingOpReplyin 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)
-
-