Package jmri.jmrit

Class AbstractIdentify

java.lang.Object
jmri.jmrit.AbstractIdentify
All Implemented Interfaces:
EventListener, ProgListener
Direct Known Subclasses:
IdentifyDecoder, IdentifyLoco

public abstract class AbstractIdentify extends Object implements ProgListener
Abstract base for common code of IdentifyLoco and IdentifyDecoder, the two classes that use a programmer to match Roster entries to what's on the programming track.

This is a class (instead of a Roster member function) to simplify use of Programmer callbacks.

See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • test1

      public abstract boolean test1()
    • test2

      public abstract boolean test2(int value)
    • test3

      public abstract boolean test3(int value)
    • test4

      public abstract boolean test4(int value)
    • test5

      public abstract boolean test5(int value)
    • test6

      public abstract boolean test6(int value)
    • test7

      public abstract boolean test7(int value)
    • test8

      public abstract boolean test8(int value)
    • test9

      public abstract boolean test9(int value)
    • statusUpdate

      protected abstract void statusUpdate(String status)
      Update the status field (if any). Invoked with "Done" when the results are in.
      Parameters:
      status - the new status
    • start

      public void start()
      Start the identification state machine.
    • identifyDone

      protected void identifyDone()
      Stop the identification state machine. This also stops the identification process. Its invoked when a testN returns true; that routine should _not_ have invoked a read or write that will result in a callback.
    • programmingOpReply

      public void programmingOpReply(int value, int status)
      Internal method to handle the programmer callbacks, e.g. when a CV read request terminates. Each will reduce (if possible) the list of consistent decoders, and starts the next step.
      Specified by:
      programmingOpReply in interface ProgListener
      Parameters:
      value - the value returned
      status - the status reported
    • error

      protected abstract void error()
      Abstract routine to notify of errors.
    • isRunning

      public boolean isRunning()
      To check if running now.
      Returns:
      true if running; false otherwise
    • readCV

      protected void readCV(String cv)
      Read a single CV for the next step.
      Parameters:
      cv - the CV to read
    • writeCV

      protected void writeCV(String cv, int value)
      Write a single CV for the next step.
      Parameters:
      cv - the CV to write
      value - to write to the CV
    • isOptionalCv

      public boolean isOptionalCv()
      Check the current status of the optionalCv flag.
      • If true, prevents the next CV read from aborting the identification process.
      • Always false after a successful read.
      Returns:
      the current status of the optionalCv flag
    • setOptionalCv

      public void setOptionalCv(boolean flag)
      Specify whether the next CV read may legitimately fail in some cases.
      Parameters:
      flag - Set true to indicate that the next read may fail. A successful read will automatically set to false.