Class NceMacroEditPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- jmri.util.swing.JmriPanel
-
- jmri.jmrix.nce.swing.NcePanel
-
- jmri.jmrix.nce.macro.NceMacroEditPanel
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,AbstractMRListener
,NceListener
,NcePanelInterface
public class NceMacroEditPanel extends NcePanel implements NceListener
Frame for user edit of NCE macros NCE macros are stored in Command Station (CS) memory starting at address xC800 (PH5 0x6000). Each macro consists of 20 bytes. The last macro 255 is at address xDBEC.Macro addr 0 xC800
Macro addr 1 xC814
Macro addr 2 xC828
Macro addr 3 xC83C
. . . .
Macro addr 255 xDBEC
Each macro can close or throw up to ten accessories. Macros can also be linked together. Two bytes (16 bit word) define an accessory address and command, or the address of the next macro to be executed. If the upper byte of the macro data word is xFF, then the next byte contains the address of the next macro to be executed by the NCE CS. For example, xFF08 means link to macro 8. NCE uses the NMRA DCC accessory decoder packet format for the word definition of their macros.
Macro data byte: bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
_ _ _ _ _ _ _ _ _ _ _ 1 0 A A A A A A 1 A A A C D D D
addr bit 7 6 5 4 3 2 10 9 8 1 0 turnout T
By convention, MSB address bits 10 - 8 are one's complement. NCE macros always set the C bit to 1. The LSB "D" (0) determines if the accessory is to be thrown (0) or closed (1). The next two bits "D D" are the LSBs of the accessory address. Note that NCE display addresses are 1 greater than NMRA DCC. Note that address bit 2 isn't supposed to be inverted, but it is the way NCE implemented their macros. Examples: 81F8 = accessory 1 thrown 9FFC = accessory 123 thrown B5FD = accessory 211 close BF8F = accessory 2044 close FF10 = link macro 16
Updated for including the USB 7.* for 1.65 command station Variables found on cab context page 14 (Cab address 14) macro table 0xE00-0xEFF, cab address = 0x0E 16 entries of 16 bytes organized as:
macro 0, high byte, low byte - 7 more times (8 accy commands total)
macro 1, high byte, low byte - 7 more times (8 accy commands total)
. . . .
macro 16, high byte, low byte - 7 more times (8 accy commands total)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NceMacroEditPanel.Default
Nested class to create one of these using old-style defaults-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.JTextField
accyTextField1
(package private) javax.swing.JTextField
accyTextField10
(package private) javax.swing.JTextField
accyTextField2
(package private) javax.swing.JTextField
accyTextField3
(package private) javax.swing.JTextField
accyTextField4
(package private) javax.swing.JTextField
accyTextField5
(package private) javax.swing.JTextField
accyTextField6
(package private) javax.swing.JTextField
accyTextField7
(package private) javax.swing.JTextField
accyTextField8
(package private) javax.swing.JTextField
accyTextField9
(package private) javax.swing.JButton
backUpButton
(package private) javax.swing.JCheckBox
checkBoxEmpty
(package private) javax.swing.JCheckBox
checkBoxNce
(package private) javax.swing.JButton
cmdButton1
(package private) javax.swing.JButton
cmdButton10
(package private) javax.swing.JButton
cmdButton2
(package private) javax.swing.JButton
cmdButton3
(package private) javax.swing.JButton
cmdButton4
(package private) javax.swing.JButton
cmdButton5
(package private) javax.swing.JButton
cmdButton6
(package private) javax.swing.JButton
cmdButton7
(package private) javax.swing.JButton
cmdButton8
(package private) javax.swing.JButton
cmdButton9
(package private) javax.swing.JButton
deleteButton1
(package private) javax.swing.JButton
deleteButton10
(package private) javax.swing.JButton
deleteButton2
(package private) javax.swing.JButton
deleteButton3
(package private) javax.swing.JButton
deleteButton4
(package private) javax.swing.JButton
deleteButton5
(package private) javax.swing.JButton
deleteButton6
(package private) javax.swing.JButton
deleteButton7
(package private) javax.swing.JButton
deleteButton8
(package private) javax.swing.JButton
deleteButton9
(package private) javax.swing.JButton
getButton
(package private) javax.swing.JLabel
macroReply
(package private) javax.swing.JTextField
macroTextField
(package private) java.lang.Thread
nceMemoryThread
(package private) javax.swing.JButton
nextButton
(package private) javax.swing.JLabel
num1
(package private) javax.swing.JLabel
num10
(package private) javax.swing.JLabel
num2
(package private) javax.swing.JLabel
num3
(package private) javax.swing.JLabel
num4
(package private) javax.swing.JLabel
num5
(package private) javax.swing.JLabel
num6
(package private) javax.swing.JLabel
num7
(package private) javax.swing.JLabel
num8
(package private) javax.swing.JLabel
num9
(package private) javax.swing.JButton
previousButton
(package private) int
recChar
response from read(package private) int[]
recChars
(package private) javax.swing.JButton
restoreButton
(package private) javax.swing.JButton
saveButton
(package private) javax.swing.JLabel
space15
(package private) javax.swing.JLabel
space2
(package private) javax.swing.JLabel
space3
(package private) javax.swing.JLabel
space4
(package private) javax.swing.JLabel
textAccy1
(package private) javax.swing.JLabel
textAccy10
(package private) javax.swing.JLabel
textAccy2
(package private) javax.swing.JLabel
textAccy3
(package private) javax.swing.JLabel
textAccy4
(package private) javax.swing.JLabel
textAccy5
(package private) javax.swing.JLabel
textAccy6
(package private) javax.swing.JLabel
textAccy7
(package private) javax.swing.JLabel
textAccy8
(package private) javax.swing.JLabel
textAccy9
(package private) javax.swing.JLabel
textMacro
(package private) javax.swing.JLabel
textReply
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description NceMacroEditPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buttonActionCmdPerformed(java.awt.event.ActionEvent ae)
void
buttonActionDeletePerformed(java.awt.event.ActionEvent ae)
void
buttonActionPerformed(java.awt.event.ActionEvent ae)
void
checkBoxActionPerformed(java.awt.event.ActionEvent ae)
java.lang.String
getHelpTarget()
Provide a help target string which an enclosing frame can provide as a help reference.java.awt.Dimension
getMinimumDimension()
The minimum frame size for font size 16java.lang.String
getTitle()
Provide a recommended title for an enclosing frame.void
initComponents(NceSystemConnectionMemo memo)
2nd stage of initialization, invoked after the constuctor is complete.void
initContext(java.lang.Object context)
3rd stage of initialization, invoked after Swing components exist.void
message(NceMessage m)
void
reply(NceReply r)
-
Methods inherited from class jmri.util.swing.JmriPanel
dispose, getMenus, getWindowInterface, initComponents, isMultipleInstances, setWindowInterface
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods 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, update
-
Methods 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, validateTree
-
Methods 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 Detail
-
nceMemoryThread
java.lang.Thread nceMemoryThread
-
textMacro
javax.swing.JLabel textMacro
-
textReply
javax.swing.JLabel textReply
-
macroReply
javax.swing.JLabel macroReply
-
previousButton
javax.swing.JButton previousButton
-
nextButton
javax.swing.JButton nextButton
-
getButton
javax.swing.JButton getButton
-
saveButton
javax.swing.JButton saveButton
-
backUpButton
javax.swing.JButton backUpButton
-
restoreButton
javax.swing.JButton restoreButton
-
checkBoxEmpty
javax.swing.JCheckBox checkBoxEmpty
-
checkBoxNce
javax.swing.JCheckBox checkBoxNce
-
macroTextField
javax.swing.JTextField macroTextField
-
space2
javax.swing.JLabel space2
-
space3
javax.swing.JLabel space3
-
space4
javax.swing.JLabel space4
-
space15
javax.swing.JLabel space15
-
num1
javax.swing.JLabel num1
-
textAccy1
javax.swing.JLabel textAccy1
-
accyTextField1
javax.swing.JTextField accyTextField1
-
cmdButton1
javax.swing.JButton cmdButton1
-
deleteButton1
javax.swing.JButton deleteButton1
-
num2
javax.swing.JLabel num2
-
textAccy2
javax.swing.JLabel textAccy2
-
accyTextField2
javax.swing.JTextField accyTextField2
-
cmdButton2
javax.swing.JButton cmdButton2
-
deleteButton2
javax.swing.JButton deleteButton2
-
num3
javax.swing.JLabel num3
-
textAccy3
javax.swing.JLabel textAccy3
-
accyTextField3
javax.swing.JTextField accyTextField3
-
cmdButton3
javax.swing.JButton cmdButton3
-
deleteButton3
javax.swing.JButton deleteButton3
-
num4
javax.swing.JLabel num4
-
textAccy4
javax.swing.JLabel textAccy4
-
accyTextField4
javax.swing.JTextField accyTextField4
-
cmdButton4
javax.swing.JButton cmdButton4
-
deleteButton4
javax.swing.JButton deleteButton4
-
num5
javax.swing.JLabel num5
-
textAccy5
javax.swing.JLabel textAccy5
-
accyTextField5
javax.swing.JTextField accyTextField5
-
cmdButton5
javax.swing.JButton cmdButton5
-
deleteButton5
javax.swing.JButton deleteButton5
-
num6
javax.swing.JLabel num6
-
textAccy6
javax.swing.JLabel textAccy6
-
accyTextField6
javax.swing.JTextField accyTextField6
-
cmdButton6
javax.swing.JButton cmdButton6
-
deleteButton6
javax.swing.JButton deleteButton6
-
num7
javax.swing.JLabel num7
-
textAccy7
javax.swing.JLabel textAccy7
-
accyTextField7
javax.swing.JTextField accyTextField7
-
cmdButton7
javax.swing.JButton cmdButton7
-
deleteButton7
javax.swing.JButton deleteButton7
-
num8
javax.swing.JLabel num8
-
textAccy8
javax.swing.JLabel textAccy8
-
accyTextField8
javax.swing.JTextField accyTextField8
-
cmdButton8
javax.swing.JButton cmdButton8
-
deleteButton8
javax.swing.JButton deleteButton8
-
num9
javax.swing.JLabel num9
-
textAccy9
javax.swing.JLabel textAccy9
-
accyTextField9
javax.swing.JTextField accyTextField9
-
cmdButton9
javax.swing.JButton cmdButton9
-
deleteButton9
javax.swing.JButton deleteButton9
-
num10
javax.swing.JLabel num10
-
textAccy10
javax.swing.JLabel textAccy10
-
accyTextField10
javax.swing.JTextField accyTextField10
-
cmdButton10
javax.swing.JButton cmdButton10
-
deleteButton10
javax.swing.JButton deleteButton10
-
recChar
int recChar
response from read
-
recChars
int[] recChars
-
-
Constructor Detail
-
NceMacroEditPanel
public NceMacroEditPanel()
-
-
Method Detail
-
initContext
public void initContext(java.lang.Object context)
3rd stage of initialization, invoked after Swing components exist.- Overrides:
initContext
in classNcePanel
- Parameters:
context
- the context that this panel may be initialized with
-
getHelpTarget
public java.lang.String 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:
getHelpTarget
in classJmriPanel
- Returns:
- the target String
-
getTitle
public java.lang.String getTitle()
Provide a recommended title for an enclosing frame.
-
getMinimumDimension
public java.awt.Dimension getMinimumDimension()
The minimum frame size for font size 16- Overrides:
getMinimumDimension
in classJmriPanel
-
initComponents
public void initComponents(NceSystemConnectionMemo memo)
2nd stage of initialization, invoked after the constuctor is complete.This needs to be connected to the initContext() method in implementing classes.
- Specified by:
initComponents
in interfaceNcePanelInterface
- Overrides:
initComponents
in classNcePanel
- Parameters:
memo
- the system connection memo for this connection
-
buttonActionPerformed
public void buttonActionPerformed(java.awt.event.ActionEvent ae)
-
buttonActionCmdPerformed
public void buttonActionCmdPerformed(java.awt.event.ActionEvent ae)
-
buttonActionDeletePerformed
public void buttonActionDeletePerformed(java.awt.event.ActionEvent ae)
-
checkBoxActionPerformed
public void checkBoxActionPerformed(java.awt.event.ActionEvent ae)
-
message
public void message(NceMessage m)
- Specified by:
message
in interfaceNceListener
-
reply
public void reply(NceReply r)
- Specified by:
reply
in interfaceNceListener
-
-