Class IdentifyDecoder

  • All Implemented Interfaces:
    java.util.EventListener, ProgListener

    public abstract class IdentifyDecoder
    extends AbstractIdentify
    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 CV47(MSB), CV48, CV49 (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() and isOptionalCv() 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
      i.e. productID = CV256 | ((CV255 & 7) << 8) | (CV253 << 11)
    • 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 the readCV(cv) call.
    • At the next step, check the returned value of isOptionalCv(). If it is still true, the CV read failed (despite retries) and the contents of the value field are undefined. You can either:
      • return true to indicate the Identify process has completed successfully without using the failed CV.
      • Set up an alternate CV read/write procedure and return false to continue. Don't forget to call setOptionalCv(false) if the next CV read is not intended to be optional.

    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:
    CombinedLocoSelPane, NewLocoSelPane