Class NceShowCabPanel
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,EventListener,Accessible,AbstractMRListener,NceListener,NcePanelInterface
Note, NCE bit layout MSB = bit 7, LSB = bit 0.
From Jim Scorse at NCE:
Each cab has a 256 byte "context page" in system RAM These pages start at 0x8000 in system RAM with Cab 0 at 0x8800, cab 1 at 0x8900, Cab 2 at 0x8a00, etc. (PH5 0x3C00)
Below is a list of offsets (in decimal) into the cab context page for useful memory locations.
For example if you want to know the current speed of cab address 2's currently selected loco look at memory location 0x8a00 + 32 dec (0x20). This will be address 0x8a20.
To determine if a cab is active (plugged in at any point this session) you
will need to look at the byte "FLAGS1" (offset 101)
If bit 1 of FLAGS1 = 1 then the cab has been talked to at least once by the command station.
Bits 0 and 7 indicate the type of cab being use this session at this cab address
Bit 7,0 = 0,0 Procab or other cab with an LCD display (type A) Bit 7,0 = 0,1 Cab04 other cab without an LCD (type B) Bit 7,0 = 1,0 USB or similar device (type C) Bit 7,0 = 1,1 AIU or similar device (type D)
CAB_BASE EQU 0 ; LCD_TOP_LINE EQU 0 ;16 chars (in ASCII) for top line of LCD
LCD_BOT_LINE EQU 16 ;16 chars (in ASCII) for bottom line of LCD
CURR_SPEED EQU 32 ;this cab's current speed ADDR_H EQU 33 ;loco address, high byte ADDR_L EQU 34 ;loco address, low byte FLAGS EQU 35 ;bit 0 - Do not use ;bit 1 - 1=128 speed mode, 0=28 speed mode ;bit 2 - 1=forward, 0=reverse ;bit 3 - Do not use ;bit 4 - Do not use ;bit 5 - Do not use ;bit 6 - Do not use ;bit 7 - 1=rear loco of consist is active address use reverse speeds
FUNCTION_L EQU 36 ;bit 0 = function 1, 1=on, 0=off ;bit 1 = function 2, 1=on, 0=off ;bit 2 = function 3, 1=on, 0=off ;bit 3 = function 4, 1=on, 0=off ;bit 4 = headlight, 1=on, 0=off
FUNCTION_H EQU 37 ;bit 0 = function 5, 1=on, 0=off ;bit 1 = function 6, 1=on, 0=off ;bit 2 = function 7, 1=on, 0=off ;bit 3 = function 8, 1=on, 0=off ;bit 4 = function 9, 1=on, 0=off ;bit 5 = function 10, 1=on, 0=off ;bit 6 = function 11, 1=on, 0=off ;bit 7 = function 12, 1=on, 0=off
ALIAS EQU 38 ;If loco is in consist this is the consist address
FUNC13_20 EQU 82 ;bit map of current functions (bit 0=F13) FUNC21_28 EQU 83
;bit map of current functions (bit 0=F21)
ACC_AD_H EQU 90 ;current accessory address high byte ACC_AD_L EQU 91 ;current accessory address low byte
;lower nibble bit 0 =1 if setup advanced consist in process
FLAGS2 EQU 93 ;bit 0 = \ ;bit 1 = >Number of recalls for this cab ;bit 2 = / 1-6 valid ;bit 3 = 1=refresh LCD on ProCab ;bit 4 = Do not use ;bit 5 = Do not use ;bit 6 = Do not use ;bit 7 = Do not use
FLAGS1 EQU 101 ;bit0 - 0 = type a or type C cab, 1 = type b or type d ;bit1 - 0 = cab type not determined, 1 = it has ;bit2 - 0 = Do not use ;bit3 - 0 = Do not use ;bit4 - 0 = Do not use ;bit5 - 0 = Do not use ;bit6 - 0 = Do not use ;bit7 - 0 = type a or type b cab, 1=type c or d Writing zero to FLAGS1 will remove the cab from the 'active' list
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classstatic classNested class to create one of these using old-style defaults.(package private) classNested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescription(package private) Thread(package private) NceShowCabPanel.DataRow[](package private) NceShowCabPanel.NceCabTableModel(package private) JTable(package private) JCheckBox(package private) JCheckBox(package private) Thread(package private) int(package private) int[](package private) JButton(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabel(package private) JLabelFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddItem(JPanel p, JComponent c, int x, int y) protected voidaddItemLeft(JPanel p, JComponent c, int x, int y) protected voidaddItemTop(JPanel p, JComponent c, int x, int y) voidvoidvoidvoidvoiddispose()Provide a help target string which an enclosing frame can provide as a help reference.The minimum frame size for font size 16getTitle()Provide a recommended title for an enclosing frame.void2nd stage of initialization, invoked after the constuctor is complete.voidinitContext(Object context) 3rd stage of initialization, invoked after Swing components exist.voidvoidpurgeCab(int cab) void(package private) voidsetColumnPurgeButton(JTable table, int column) Methods inherited from class jmri.util.swing.JmriPanel
getMenus, getWindowInterface, initComponents, 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
-
nceCabUpdateThread
-
autoRefreshThread
-
textNumber
-
textCab
-
textAddrType
-
textAddress
-
textSpeed
-
textConsist
-
textConsistPos
-
textFunctions
-
textDisplay1
-
textDisplay2
-
textReply
-
textStatus
-
textLastUsed
-
refreshButton
-
checkBoxShowAllCabs
-
checkBoxAutoRefresh
-
cabData
-
cabModel
-
cabTable
-
recChar
int recChar -
recChars
int[] recChars
-
-
Constructor Details
-
NceShowCabPanel
public NceShowCabPanel()
-
-
Method Details
-
initContext
3rd stage of initialization, invoked after Swing components exist.- Overrides:
initContextin classNcePanel- Parameters:
context- the context that this panel may be initialized with
-
getHelpTarget
Provide 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
Provide a recommended title for an enclosing frame. -
getMinimumDimension
The minimum frame size for font size 16- Overrides:
getMinimumDimensionin classJmriPanel
-
initComponents
2nd stage of initialization, invoked after the constuctor is complete.This needs to be connected to the initContext() method in implementing classes.
- Specified by:
initComponentsin interfaceNcePanelInterface- Overrides:
initComponentsin classNcePanel- Parameters:
m- the system connection memo for this connection
-
buttonActionPerformed
-
checkBoxActionPerformed
-
purgeCab
-
cabPurgeSerial
-
cabPurgeUsb
-
message
- Specified by:
messagein interfaceNceListener
-
reply
- Specified by:
replyin interfaceNceListener
-
addItem
-
addItemLeft
-
addItemTop
-
setColumnPurgeButton
-
dispose
-