Class NceMacroBackup
- java.lang.Object
-
- java.lang.Thread
-
- jmri.jmrix.nce.macro.NceMacroBackup
-
- All Implemented Interfaces:
java.lang.Runnable
,java.util.EventListener
,AbstractMRListener
,NceListener
public class NceMacroBackup extends java.lang.Thread implements NceListener
Backups NCE Macros to a text file format defined by NCE.NCE "Backup macros" dumps the macros into a text file. Each line contains the contents of one macro. The first macro, 0 starts at address xC800 (PH5 0x6000). The last macro 255 is at address xDBEC.
NCE file format:
:C800 (macro 0: 20 hex chars representing 10 accessories) :C814 (macro 1: 20 hex chars representing 10 accessories) :C828 (macro 2: 20 hex chars representing 10 accessories) . . :DBEC (macro 255: 20 hex chars representing 10 accessories) :0000
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
This backup routine uses the same macro data format as NCE.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.JLabel
macroNumber
(package private) javax.swing.JLabel
textMacro
-
Constructor Summary
Constructors Constructor Description NceMacroBackup(NceTrafficController t)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
message(NceMessage m)
void
reply(NceReply r)
void
run()
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
textMacro
javax.swing.JLabel textMacro
-
macroNumber
javax.swing.JLabel macroNumber
-
-
Constructor Detail
-
NceMacroBackup
public NceMacroBackup(NceTrafficController t)
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
message
public void message(NceMessage m)
- Specified by:
message
in interfaceNceListener
-
reply
public void reply(NceReply r)
- Specified by:
reply
in interfaceNceListener
-
-