Package jmri.jmrit.decoderdefn
Class IdentifyDecoder
java.lang.Object
jmri.jmrit.AbstractIdentify
jmri.jmrit.decoderdefn.IdentifyDecoder
- All Implemented Interfaces:
EventListener,ProgListener
Interact with a programmer to identify the
DecoderIndexFile entry for a decoder on the
programming track. Create a subclass of this which implements done(int, int, int)
to handle the results of the identification.
This is a class (instead of a DecoderIndexFile
member function) to simplify use of Programmer callbacks.
Contains manufacturer-specific code to generate a 3rd "productID" identifier, in addition to the manufacturer ID and model ID:
- Dietz (mfgID == 115) CV128 is ID
- DIY: (mfgID == 13) CV47 is the highest byte, CV48 is high byte, CV49 is low byte, CV50 is the lowest byte; (CV47 == 1) is reserved for the Czech Republic
- Doehler & Haass: (mfgID == 97) CV261 is ID from 2020 firmwares
- ESU: (mfgID == 151, modelID == 255) use RailCom® Product ID CVs; write 0=>CV31, write 255=>CV32, then CVs 261 (lowest) to 264 (highest) are a four byte ID
- Harman: (mfgID == 98) CV112 is high byte, CV113 is low byte of ID
- Hornby: (mfgID == 48)
- If CV7 = 254, this is a HN7000 series decoder. The ID is in CV200(MSB), CV201 (LSB)
- Otherwise CV159 is the ID. If (CV159 == 143), CV159 is
low byte of ID and CV158 is high byte of ID. C159 is not present in some
models, in which case no "productID" can be determined. (This code uses
setOptionalCv()andisOptionalCv()as documented below.)
- QSI: (mfgID == 113) write 254=>CV49, write 4=>CV50, then CV56 is high byte, write 5=>CV50, then CV56 is low byte of ID
- SoundTraxx: (mfgID == 141, modelID == 70, 71 or 72) The product ID is made from
- CV 256 bits 0-7
- CV 255 bits 8-10
- CV 253 bit 11-18
- TCS: (mfgID == 153) CV249 is physical hardware id, V5 and above use CV248, CV110 and CV111 to identify specific sound sets and features. New productID process triggers if (CV249 > 128).
- Train-O-Matic: (mfgID == 78) CV508 lowest byte, CV509 low byte and CV510 high byte
- Zimo: (mfgID == 145) CV250 is ID
- Optional CVs:
-
Some decoders have CVs that may or may not be present. In this case:
- Call
setOptionalCv(true)prior to thereadCV(cv)call. - At the next step, check the returned value of
isOptionalCv(). If it is stilltrue, the CV read failed (despite retries) and the contents of thevaluefield are undefined. You can either:
return trueto indicate the Identify process has completed successfully without using the failed CV.- Set up an alternate CV read/write procedure and
return falseto continue. Don't forget to callsetOptionalCv(false)if the next CV read is not intended to be optional.
- Call
TODO:
The RailCom® Product ID is a 32 bit unsigned value. productID
is currently int with -1 signifying a null value. Potential for value
conflict exists but changing would involve significant code changes
elsewhere.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumRepresents specific CV8 values. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) int(package private) IdentifyDecoder.Manufacturer(package private) int(package private) int(package private) int(package private) int(package private) int(package private) intFields inherited from interface jmri.ProgListener
CommError, ConfirmFailed, FailedTimeout, NoAck, NoLocoDetected, NotImplemented, OK, ProgrammerBusy, ProgrammingShort, SequenceError, UnknownError, UserAborted -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddone(int mfgID, int modelID, int productID) Indicate when identification is complete.protected abstract voidProvide a user-readable message about progress.protected voidUpdate the status field (if any).booleantest1()booleantest2(int value) booleantest3(int value) booleantest4(int value) booleantest5(int value) booleantest6(int value) booleantest7(int value) booleantest8(int value) booleantest9(int value) Methods inherited from class jmri.jmrit.AbstractIdentify
error, identifyDone, isOptionalCv, isRunning, programmingOpReply, readCV, setOptionalCv, start, writeCV
-
Field Details
-
mfgID
-
intMfg
int intMfg -
modelID
int modelID -
productIDhigh
int productIDhigh -
productIDlow
int productIDlow -
productIDhighest
int productIDhighest -
productIDlowest
int productIDlowest -
productID
int productID
-
-
Constructor Details
-
IdentifyDecoder
-
-
Method Details
-
test1
- Specified by:
test1in classAbstractIdentify
-
test2
- Specified by:
test2in classAbstractIdentify
-
test3
- Specified by:
test3in classAbstractIdentify
-
test4
- Specified by:
test4in classAbstractIdentify
-
test5
- Specified by:
test5in classAbstractIdentify
-
test6
- Specified by:
test6in classAbstractIdentify
-
test7
- Specified by:
test7in classAbstractIdentify
-
test8
- Specified by:
test8in classAbstractIdentify
-
test9
- Specified by:
test9in classAbstractIdentify
-
statusUpdate
Description copied from class:AbstractIdentifyUpdate the status field (if any). Invoked with "Done" when the results are in.- Specified by:
statusUpdatein classAbstractIdentify- Parameters:
s- the new status
-
done
Indicate when identification is complete.- Parameters:
mfgID- identified manufacturer identitymodelID- identified model identityproductID- identified product identity
-
message
Provide a user-readable message about progress.- Parameters:
m- the message to provide
-