Class Ds64TabbedPanel
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,EventListener,Accessible,LocoNetListener,LnPanelInterface
The read and write operations require a sequence of operations, which are handled with a state variable.
Programming of the DS64 is done via LocoNet configuration messages, so the DS64 should not be manually put into its programming mode via the DS64 built-in pushbutton while this tool is in use.
Some of the message formats used in this class are Copyright Digitrax, Inc. and used with permission as part of the JMRI project. That permission does not extend to uses in other software products. If you wish to use this code, algorithm or these message formats outside of JMRI, please contact Digitrax Inc for separate permission.
Extensions to include read/write of turnout output addresses and routes are based on reverse-engineering of DS64 operating characteristics by B. Milhaupt. As such, this tool may not be compatible with all DS64 devices.
This file is part of JMRI.
JMRI is free 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.
Based on Revision 1.1 of DS64Panel.java by Bob Jacobsen
- See Also:
-
Nested Class Summary
Nested 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.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescription(package private) int[](package private) Component(package private) JLabel(package private) JLabel(package private) JLabel(package private) JToggleButton(package private) JPanel(package private) JTabbedPane(package private) Integer(package private) Boolean(package private) Boolean(package private) JLabel(package private) JPanel(package private) jmri.jmrix.loconet.ds64.Ds64TabbedPanel.JRadioButtonWithInteger[](package private) JPanel(package private) JScrollPane(package private) JPanel(package private) jmri.jmrix.loconet.ds64.Ds64TabbedPanel.JRadioButtonWithInteger[](package private) int(package private) ValidatedTextField(package private) ValidatedTextField(package private) ValidatedTextField(package private) ValidatedTextField(package private) JCheckBox(package private) JCheckBox(package private) JCheckBox(package private) JCheckBox(package private) JPanel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) Boolean(package private) JToggleButton(package private) SimpleTurnoutStateEntry[](package private) SimpleTurnoutStateEntry[](package private) SimpleTurnoutStateEntry[](package private) SimpleTurnoutStateEntry[](package private) SimpleTurnoutStateEntry[](package private) SimpleTurnoutStateEntry[](package private) SimpleTurnoutStateEntry[](package private) JPanel[](package private) JLabel(package private) JTabbedPane(package private) SimpleTurnoutStateEntry[](package private) JLabel(package private) JPanel(package private) JLabel(package private) JLabelFields inherited from class jmri.jmrix.loconet.AbstractBoardProgPanel
addrField, onlyOneOperation, opsw, pacingTimer, read, readAllButton, responseTimer, state, writeAllButtonFields 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
ConstructorsConstructorDescriptionDs64TabbedPanel constructor when the boardNum is not already known.Ds64TabbedPanel(boolean readBoardOnInit) Ds64TabbedPanel constructor when the boardNum is not known; BoardID 1 is assumed.Ds64TabbedPanel(boolean readOnInit, Integer[] boardNums) Ds64TabbedPanel constructor which may be used when the instantiating method already has an array of DS64 BoardID numbers; this array is used to pre-populate the GUI combobox showing BoardID numbers.Ds64TabbedPanel(int boardNum) Ds64TabbedPanel constructor when the boardNum is already known.Ds64TabbedPanel(int boardNum, boolean readOnInit) Ds64TabbedPanel constructor when the boardNum is already known. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCopy from the GUI OpSw tab to the GUI Basics tabprotected voidCopy from the GUI to the opsw array.Provide a help target string which an enclosing frame can provide as a help reference.getTitle()Provide a recommended title for an enclosing frame.void2nd stage of initialization, invoked after the constructor is complete.void2nd stage of initialization, invoked after the constructor is complete.voidProcesses incoming LocoNet message m for OpSw responses to read and write operation messages, and automatically advances to the next OpSw operation as directed byAbstractBoardProgPanel.nextState(int).protected intnextState(int state) Compute the next OpSw number to be accessed, based on the current OpSw number.voidreadAll()Provides a mechanism to read several OpSw values in a sequence.protected voidsetOpSwIndex(int index) Set index into OpSw tablevoidprotected voidUpdate the GUI based on the contents of opsw[].voidupdateGuiBasicOpSw(int index) (package private) voidprotected voidupdateOpswForWrite(int index) Updates OpSw values for a given index into the data arrayprotected voidupdateOpSwsOutAddr(int address1, boolean state1, boolean is1Unused, int address2, boolean state2, boolean is2Unused) Updates data register to reflect address, state, and enable for two turnouts.voidwriteAll()Provide a mechanism to write several OpSw values in a sequence.Methods inherited from class jmri.jmrix.loconet.AbstractBoardProgPanel
appendLine, dispose, doTheNextThing, getBoardIdValue, panelToScroll, provideAddressing, provideAddressing, provideStatusLine, setBoardIdValue, setStatus, setTypeWord, writeOneMethods inherited from class jmri.jmrix.loconet.swing.LnPanel
getTitle, getTitleHelper, initContextMethods inherited from class jmri.util.swing.JmriPanel
getMenus, getMinimumDimension, getWindowInterface, 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
-
boardNumbers
int[] boardNumbers -
origAccessBoardNum
-
boardNumsEntryValue
-
generalPanel
-
opswsPanel
-
opswsScrollPane
-
generalTabbedPane
-
routesTabbedPane
-
opswsValues
-
outputAddrsPanel
-
outAddr1
-
outState1
-
outAddr2
-
outState2
-
outAddr3
-
outState3
-
outAddr4
-
outState4
-
routePanel
-
routeTop
-
routeA2
-
routeA3
-
routeA4
-
routeA5
-
routeA6
-
routeA7
-
routeA8
-
resetRouteButton
-
addressComboBox
-
outputTypeLabel
-
outputType
-
delayTimeLabel
-
delayTime
-
outputStatesLabel
-
outputStates
-
startupDelayLabel
-
startupDelay
-
staticOutputShutoffLabel
-
staticOutputShutoff
-
commandTypeLabel
-
commandType
-
commandSourceLabel
-
commandSource
-
output1CrossbuckFlasherCheckBox
-
output2CrossbuckFlasherCheckBox
-
output3CrossbuckFlasherCheckBox
-
output4CrossbuckFlasherCheckBox
-
routesControlLabel
-
routesControl
-
localControlOfOutputsStyleLabel
-
localControlOfOutputsStyle
-
sensorMessageTriggerLabel
-
sensorMessageTrigger
-
localSensorType
-
factoryResetButton
-
opswThrown
jmri.jmrix.loconet.ds64.Ds64TabbedPanel.JRadioButtonWithInteger[] opswThrown -
opswClosed
jmri.jmrix.loconet.ds64.Ds64TabbedPanel.JRadioButtonWithInteger[] opswClosed -
sensorMessageTriggerPanel
-
localInputControlsPanel
-
boardResetResponseTimer
-
colorizedObject
-
isRead
-
isWritingResetOpSw
-
indexToRead
-
resetOpSwVal
-
-
Constructor Details
-
Ds64TabbedPanel
Ds64TabbedPanel constructor when the boardNum is already known. Allows the instantiating method to specify whether the basic feature configuration information will be read upon instantiation.- Parameters:
boardNum- initial BoardID numberreadOnInit- true to automatically read the basic configuration info.
-
Ds64TabbedPanel
public Ds64TabbedPanel()Ds64TabbedPanel constructor when the boardNum is not already known.At instantiation, the object will automatically assume BoardID 1 and will not pre-read the basic board configuration information.
-
Ds64TabbedPanel
Ds64TabbedPanel constructor when the boardNum is already known.When instantiated, the object will not automatically read the basic configuration information.
- Parameters:
boardNum- initial BoardID number
-
Ds64TabbedPanel
Ds64TabbedPanel constructor which may be used when the instantiating method already has an array of DS64 BoardID numbers; this array is used to pre-populate the GUI combobox showing BoardID numbers. The first BoardID number in the array will automatically be selected upon instantiation.When instantiated, the object will automatically read the basic configuration information if readOnInit is true.
- Parameters:
readOnInit- true to automatically read the basic configuration info from the DS64 with BoardID equal to the first value in the boardNums arrayboardNums- Array of known DS64 BoardID numbers
-
Ds64TabbedPanel
Ds64TabbedPanel constructor when the boardNum is not known; BoardID 1 is assumed.Allows the instantiating method to specify whether the basic feature configuration information will be read upon instantiation.
- Parameters:
readBoardOnInit- true to automatically read the basic configuration info.
-
-
Method Details
-
getHelpTarget
Description copied from class:JmriPanelProvide a help target string which an enclosing frame can provide as a help reference.This automatically provides a reference to the usual place for JMRI window-specific help pages that are named for the implementing class, but note this is a Pane class, not a Frame class.
- Overrides:
getHelpTargetin classJmriPanel- Returns:
- the target String
-
getTitle
Description copied from class:JmriPanelProvide a recommended title for an enclosing frame. -
updateGuiBasicOpSw
-
copyToOpsw
Copy from the GUI to the opsw array.Used before write operations start.
- Specified by:
copyToOpswin classAbstractBoardProgPanel
-
updateDisplay
Description copied from class:AbstractBoardProgPanelUpdate the GUI based on the contents of opsw[].This method is executed after completion of a read operation sequence.
- Specified by:
updateDisplayin classAbstractBoardProgPanel
-
nextState
Description copied from class:AbstractBoardProgPanelCompute the next OpSw number to be accessed, based on the current OpSw number.- Specified by:
nextStatein classAbstractBoardProgPanel- Parameters:
state- current OpSw number- Returns:
- computed next OpSw nubmer
-
readAll
Description copied from class:AbstractBoardProgPanelProvides a mechanism to read several OpSw values in a sequence. The sequence is defined by theAbstractBoardProgPanel.nextState(int)method.- Overrides:
readAllin classAbstractBoardProgPanel
-
updateBoardAddress
-
writeAll
Description copied from class:AbstractBoardProgPanelProvide a mechanism to write several OpSw values in a sequence. The sequence is defined by theAbstractBoardProgPanel.nextState(int)method.- Overrides:
writeAllin classAbstractBoardProgPanel
-
setOpSwIndex
Set index into OpSw table- Parameters:
index- the indirect address
-
updateOpSwsOutAddr
protected void updateOpSwsOutAddr(int address1, boolean state1, boolean is1Unused, int address2, boolean state2, boolean is2Unused) Updates data register to reflect address, state, and enable for two turnouts.- Parameters:
address1- first turnout addressstate1- first turnout's stateis1Unused- true if first turnout entry is to be "unused"address2- second turnout addressstate2- second turnout's stateis2Unused- true if second turnout entry is to be "unused"
-
updateOpswForWrite
Updates OpSw values for a given index into the data array- Parameters:
index- indirect address
-
message
Description copied from class:AbstractBoardProgPanelProcesses incoming LocoNet message m for OpSw responses to read and write operation messages, and automatically advances to the next OpSw operation as directed byAbstractBoardProgPanel.nextState(int).- Specified by:
messagein interfaceLocoNetListener- Overrides:
messagein classAbstractBoardProgPanel- Parameters:
m- incoming LocoNet message
-
initComponents
Description copied from class:LnPanel2nd stage of initialization, invoked after the constructor is complete.This needs to be connected to the initContext() method in implementing classes.
- Specified by:
initComponentsin interfaceLnPanelInterface- Overrides:
initComponentsin classAbstractBoardProgPanel- Parameters:
memo- aLocoNetSystemConnectionMemoobject
-
initComponents
Description copied from class:JmriPanel2nd stage of initialization, invoked after the constructor is complete.- Overrides:
initComponentsin classAbstractBoardProgPanel
-
updateGuiFromOpSws33_48
void updateGuiFromOpSws33_48() -
copyOpswToBasic
Copy from the GUI OpSw tab to the GUI Basics tab
-