Class DiagnosticFrame
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- jmri.util.JmriJFrame
-
- jmri.jmrix.cmri.serial.diagnostic.DiagnosticFrame
-
- All Implemented Interfaces:
java.awt.event.ComponentListener
,java.awt.event.WindowListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
,BeanInterface
,AbstractMRListener
,SerialListener
,ModifiedFlag
,WindowInterface
public class DiagnosticFrame extends JmriJFrame implements SerialListener
Frame for running CMRI diagnostics- See Also:
- Serialized Form
-
-
Nested Class Summary
-
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.util.swing.WindowInterface
WindowInterface.Hint
-
-
Field Summary
Fields Modifier and Type Field Description protected int
begInByte
protected int
begOutByte
(package private) javax.swing.JLabel
compareErr
(package private) javax.swing.JButton
continueButton
protected int
count
(package private) DiagnosticFrame
curFrame
protected int
curOutBit
protected int
curOutByte
protected short
curOutValue
(package private) int
debugCount
protected int
endInByte
protected int
endOutByte
protected int
filterDelay
(package private) javax.swing.JTextField
filterDelayField
(package private) javax.swing.JButton
haltPollButton
protected byte[]
inBytes
(package private) javax.swing.JTextField
inCardField
protected int
inCardNum
(package private) javax.swing.JButton
initButton
(package private) javax.swing.JCheckBox
invertOutButton
(package private) javax.swing.JCheckBox
invertWrapButton
(package private) javax.swing.JCheckBox
invertWriteButton
protected boolean
isCPNODE
protected boolean
isSMINI
protected boolean
isUSIC_SUSIC
protected boolean
needInputTest
protected int
nInBytes
(package private) javax.swing.JLabel
nodeReplyLabel
(package private) javax.swing.JLabel
nodeReplyText
(package private) javax.swing.JComboBox<java.lang.String>
nodeSelBox
(package private) javax.swing.JLabel
nodeText1
(package private) javax.swing.JLabel
nodeText2
protected int
nOutBytes
protected int
numCards
protected int
numErrors
protected int
numInputCards
protected int
numIOXInputCards
protected int
numIOXOutputCards
protected int
numIterations
protected int
numOutputCards
protected int
numTestNodes
protected int
obsDelay
(package private) javax.swing.JTextField
obsDelayField
protected byte[]
outBytes
(package private) javax.swing.JTextField
outCardField
protected int
outCardNum
protected boolean
outTest
protected javax.swing.Timer
outTimer
(package private) javax.swing.JButton
pollButton
protected javax.swing.Timer
pollTimer
protected int
portsPerCard
protected int
replyCount
(package private) javax.swing.JButton
runButton
protected int
selTestType
(package private) javax.swing.JLabel
statusText1
(package private) javax.swing.JLabel
statusText2
(package private) javax.swing.JButton
stopButton
(package private) javax.swing.JLabel
testEquip
(package private) javax.swing.ButtonGroup
testGroup
protected SerialNode
testNode
int
testNodeAddr
protected int[]
testNodeAddresses
protected java.lang.String
testNodeID
protected SerialNode[]
testNodes
protected int
testNodeType
(package private) javax.swing.JLabel
testReqEquip
protected boolean
testRunning
(package private) javax.swing.JComboBox<java.lang.String>
testSelectBox
protected boolean
testSuspended
static int
testType_Outputs
static int
testType_SendCommand
static int
testType_Wraparound
static int
testType_WriteBytes
protected int
totalOutBytes
(package private) javax.swing.JTextField
uaAddrField
protected boolean
waitingOnInput
protected boolean
waitingResponse
protected byte[]
wrapBytes
protected boolean
wrapTest
protected javax.swing.Timer
wrapTimer
(package private) javax.swing.JButton
writeButton
(package private) javax.swing.JTextField
writeBytesField
(package private) javax.swing.JLabel
writeBytesLabel
(package private) javax.swing.JTextField
writeCardField
(package private) javax.swing.JLabel
writeCardLabel
-
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
-
-
Constructor Summary
Constructors Constructor Description DiagnosticFrame(CMRISystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
continueButtonActionPerformed(java.awt.event.ActionEvent e)
Handle continue button in Diagnostic Frame.(package private) SerialMessage
createOutPacket()
Create an Transmit packet (SerialMessage).void
displayNodeInfo(java.lang.String nodeID)
Method to handle selection of a Node for info display.void
haltpollButtonActionPerformed()
Halt Poll button handler Polling should be halted when executing diagnostics so as not to interfere with the test sequences.void
initComponents()
By default, Swing components should be created an installed in this method, rather than in the ctor itself.void
initializeNodes()
Initialize configured nodes and set up the node select combo box.protected boolean
initializeOutputTest()
Initialize an Output Test.protected boolean
initializeWraparoundTest()
Initialize a Wraparound Test.void
message(SerialMessage m)
void
pollButtonActionPerformed(java.awt.event.ActionEvent e)
Handle poll node button in Diagnostic Frame.protected void
pollNodeReadReply()
Run a Poll/Response Test.protected boolean
readSetupData()
Read data in Diagnostic Frame, get node data, and test for consistency.void
reply(SerialReply l)
Reply notification implementing SerialListener interfacevoid
runButtonActionPerformed(java.awt.event.ActionEvent e)
Handle run button in Diagnostic Frame.protected void
runOutputTest()
Run an Output Test.protected void
runWraparoundTest()
Run a Wraparound Test.void
sendButtonActionPerformed(java.awt.event.ActionEvent e)
Transmit bytes to selected output card starting with out card number for number of bytes entered.protected boolean
sendInitalizePacket()
Transmit an Initialize message to the test node.void
stopButtonActionPerformed(java.awt.event.ActionEvent e)
Handle Stop button in Diagnostic Frame.protected void
stopOutputTest()
Stop an Output Test.protected void
stopWraparoundTest()
Stop a Wraparound Test.void
windowClosing(java.awt.event.WindowEvent e)
Stop operation when window closing-
Methods inherited from class jmri.util.JmriJFrame
addHelpMenu, componentHidden, componentMoved, componentResized, componentShown, dispose, 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, 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
-
numTestNodes
protected int numTestNodes
-
testNodes
protected SerialNode[] testNodes
-
testNodeAddresses
protected int[] testNodeAddresses
-
testNode
protected SerialNode testNode
-
testNodeAddr
public int testNodeAddr
-
testNodeID
protected java.lang.String testNodeID
-
testNodeType
protected int testNodeType
-
nodeSelBox
javax.swing.JComboBox<java.lang.String> nodeSelBox
-
testSelectBox
javax.swing.JComboBox<java.lang.String> testSelectBox
-
testType_Outputs
public static final int testType_Outputs
- See Also:
- Constant Field Values
-
testType_Wraparound
public static final int testType_Wraparound
- See Also:
- Constant Field Values
-
testType_SendCommand
public static final int testType_SendCommand
- See Also:
- Constant Field Values
-
testType_WriteBytes
public static final int testType_WriteBytes
- See Also:
- Constant Field Values
-
selTestType
protected int selTestType
-
outTest
protected boolean outTest
-
wrapTest
protected boolean wrapTest
-
isSMINI
protected boolean isSMINI
-
isUSIC_SUSIC
protected boolean isUSIC_SUSIC
-
isCPNODE
protected boolean isCPNODE
-
numOutputCards
protected int numOutputCards
-
numInputCards
protected int numInputCards
-
numCards
protected int numCards
-
numIOXInputCards
protected int numIOXInputCards
-
numIOXOutputCards
protected int numIOXOutputCards
-
outCardNum
protected int outCardNum
-
obsDelay
protected int obsDelay
-
inCardNum
protected int inCardNum
-
filterDelay
protected int filterDelay
-
testRunning
protected boolean testRunning
-
testSuspended
protected boolean testSuspended
-
outBytes
protected byte[] outBytes
-
curOutByte
protected int curOutByte
-
curOutBit
protected int curOutBit
-
curOutValue
protected short curOutValue
-
nOutBytes
protected int nOutBytes
-
begOutByte
protected int begOutByte
-
endOutByte
protected int endOutByte
-
totalOutBytes
protected int totalOutBytes
-
portsPerCard
protected int portsPerCard
-
inBytes
protected byte[] inBytes
-
wrapBytes
protected byte[] wrapBytes
-
nInBytes
protected int nInBytes
-
begInByte
protected int begInByte
-
replyCount
protected int replyCount
-
endInByte
protected int endInByte
-
numErrors
protected int numErrors
-
numIterations
protected int numIterations
-
outTimer
protected javax.swing.Timer outTimer
-
wrapTimer
protected javax.swing.Timer wrapTimer
-
pollTimer
protected javax.swing.Timer pollTimer
-
waitingOnInput
protected boolean waitingOnInput
-
waitingResponse
protected boolean waitingResponse
-
needInputTest
protected boolean needInputTest
-
count
protected int count
-
debugCount
int debugCount
-
testGroup
javax.swing.ButtonGroup testGroup
-
invertOutButton
javax.swing.JCheckBox invertOutButton
-
invertWrapButton
javax.swing.JCheckBox invertWrapButton
-
invertWriteButton
javax.swing.JCheckBox invertWriteButton
-
initButton
javax.swing.JButton initButton
-
pollButton
javax.swing.JButton pollButton
-
writeButton
javax.swing.JButton writeButton
-
haltPollButton
javax.swing.JButton haltPollButton
-
uaAddrField
javax.swing.JTextField uaAddrField
-
outCardField
javax.swing.JTextField outCardField
-
inCardField
javax.swing.JTextField inCardField
-
obsDelayField
javax.swing.JTextField obsDelayField
-
filterDelayField
javax.swing.JTextField filterDelayField
-
writeCardField
javax.swing.JTextField writeCardField
-
writeBytesField
javax.swing.JTextField writeBytesField
-
runButton
javax.swing.JButton runButton
-
stopButton
javax.swing.JButton stopButton
-
continueButton
javax.swing.JButton continueButton
-
nodeText1
javax.swing.JLabel nodeText1
-
nodeText2
javax.swing.JLabel nodeText2
-
testReqEquip
javax.swing.JLabel testReqEquip
-
testEquip
javax.swing.JLabel testEquip
-
nodeReplyLabel
javax.swing.JLabel nodeReplyLabel
-
nodeReplyText
javax.swing.JLabel nodeReplyText
-
writeCardLabel
javax.swing.JLabel writeCardLabel
-
writeBytesLabel
javax.swing.JLabel writeBytesLabel
-
statusText1
javax.swing.JLabel statusText1
-
statusText2
javax.swing.JLabel statusText2
-
compareErr
javax.swing.JLabel compareErr
-
curFrame
DiagnosticFrame curFrame
-
-
Constructor Detail
-
DiagnosticFrame
public DiagnosticFrame(CMRISystemConnectionMemo memo)
-
-
Method Detail
-
initComponents
public void initComponents()
By default, Swing components should be created an installed in this method, rather than in the ctor itself.- Overrides:
initComponents
in classJmriJFrame
-
initializeNodes
public void initializeNodes()
Initialize configured nodes and set up the node select combo box.
-
displayNodeInfo
public void displayNodeInfo(java.lang.String nodeID)
Method to handle selection of a Node for info display.- Parameters:
nodeID
- Node ID.
-
runButtonActionPerformed
public void runButtonActionPerformed(java.awt.event.ActionEvent e)
Handle run button in Diagnostic Frame.- Parameters:
e
- unused.
-
readSetupData
protected boolean readSetupData()
Read data in Diagnostic Frame, get node data, and test for consistency. If errors are found, the errors are noted in the status panel of the Diagnostic Frame.- Returns:
- 'true' if no errors are found, 'false' if errors are found
-
continueButtonActionPerformed
public void continueButtonActionPerformed(java.awt.event.ActionEvent e)
Handle continue button in Diagnostic Frame.- Parameters:
e
- unused.
-
stopButtonActionPerformed
public void stopButtonActionPerformed(java.awt.event.ActionEvent e)
Handle Stop button in Diagnostic Frame.- Parameters:
e
- unused.
-
haltpollButtonActionPerformed
public void haltpollButtonActionPerformed()
Halt Poll button handler Polling should be halted when executing diagnostics so as not to interfere with the test sequences.
-
initializeOutputTest
protected boolean initializeOutputTest()
Initialize an Output Test. If errors are found, the errors are noted in the status panel of the Diagnostic Frame.- Returns:
- 'true' if successfully initialized, 'false' if errors are found Added synchronized
-
runOutputTest
protected void runOutputTest()
Run an Output Test.
-
stopOutputTest
protected void stopOutputTest()
Stop an Output Test.
-
sendInitalizePacket
protected boolean sendInitalizePacket()
Transmit an Initialize message to the test node.- Returns:
- 'true' if message sent successfully
-
initializeWraparoundTest
protected boolean initializeWraparoundTest()
Initialize a Wraparound Test. If errors are found, the errors are noted in the status panel of the Diagnostic Frame.- Returns:
- 'true' if successfully initialized, 'false' if errors are found
-
runWraparoundTest
protected void runWraparoundTest()
Run a Wraparound Test.
-
stopWraparoundTest
protected void stopWraparoundTest()
Stop a Wraparound Test.
-
createOutPacket
SerialMessage createOutPacket()
Create an Transmit packet (SerialMessage).- Returns:
- loaded packet to transmit
-
pollButtonActionPerformed
public void pollButtonActionPerformed(java.awt.event.ActionEvent e)
Handle poll node button in Diagnostic Frame.- Parameters:
e
- unused.
-
pollNodeReadReply
protected void pollNodeReadReply()
Run a Poll/Response Test. Returns number of bytes read or a timeout
-
sendButtonActionPerformed
public void sendButtonActionPerformed(java.awt.event.ActionEvent e)
Transmit bytes to selected output card starting with out card number for number of bytes entered. If inverted checked, data is flipped.- Parameters:
e
- unused.
-
message
public void message(SerialMessage m)
- Specified by:
message
in interfaceSerialListener
-
reply
public void reply(SerialReply l)
Reply notification implementing SerialListener interface- Specified by:
reply
in interfaceSerialListener
-
windowClosing
public void windowClosing(java.awt.event.WindowEvent e)
Stop operation when window closing- Specified by:
windowClosing
in interfacejava.awt.event.WindowListener
- Overrides:
windowClosing
in classJmriJFrame
-
-