Package jmri

Class ProgrammingMode

java.lang.Object
jmri.ProgrammingMode

@Immutable public final class ProgrammingMode extends Object
Denote a single programming mode.

User code gets a list of available modes from the Programmer or AddressedProgrammer in use. It then selects a mode to use and indicates it via a setMode() call.

A ProgrammingMode has a user-readable name to help humans select it.

We define a number of modes as constants because they are common across so many DCC-specific implementations, they've become defacto standards.

More specific definitions (and Bundle entries) should retreat to specific Programmer implementations. The whole idea is to have code deal with the modes that a specific Programmer provides, not make assumptions about global values.

See Also:
  • Field Details

    • PAGEMODE

      public static final ProgrammingMode PAGEMODE
      NMRA "Paged" mode
    • OPSBITMODE

      public static final ProgrammingMode OPSBITMODE
      NMRA "Operations" or "Programming on the main" mode, using only the bit-wise operations
    • OPSACCEXTBYTEMODE

      public static final ProgrammingMode OPSACCEXTBYTEMODE
      NMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations and "extended" addressing.
    • OPSACCBITMODE

      public static final ProgrammingMode OPSACCBITMODE
      NMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations. Note that this is defined as using the "normal", not "extended" addressing.
    • OPSACCEXTBITMODE

      public static final ProgrammingMode OPSACCEXTBITMODE
      NMRA "Programming on the main" mode for stationary decoders, using only the bit-wise operations and "extended" addressing.
    • OPSACCBYTEMODE

      public static final ProgrammingMode OPSACCBYTEMODE
      NMRA "Programming on the main" mode for stationary decoders, using only the byte-wise operations. Note that this is defined as using the "normal", not "extended" addressing.
    • ADDRESSMODE

      public static final ProgrammingMode ADDRESSMODE
      NMRA "Address-only" mode. Often implemented as a proper subset of "Register" mode, as the underlying operation is the same.
    • OPSBYTEMODE

      public static final ProgrammingMode OPSBYTEMODE
      NMRA "Operations" or "Programming on the main" mode, using only the byte-wise operations.
    • DIRECTBYTEMODE

      public static final ProgrammingMode DIRECTBYTEMODE
      NMRA "Direct" mode, using only the byte-wise operations.
    • REGISTERMODE

      public static final ProgrammingMode REGISTERMODE
      NMRA "Register" mode.
    • DIRECTBITMODE

      public static final ProgrammingMode DIRECTBITMODE
      NMRA "Direct" mode, using only the bit-wise operations.
    • DIRECTMODE

      public static final ProgrammingMode DIRECTMODE
      NMRA "Direct" mode, using both the bit-wise and byte-wise operations.
  • Constructor Details

    • ProgrammingMode

      public ProgrammingMode(@Nonnull String standardName)
      Create a ProgrammingMode instance.
      Parameters:
      standardName - a name, not to be translated, for internal use
    • ProgrammingMode

      public ProgrammingMode(@Nonnull String standardName, @Nonnull String localName)
      Create an instance with a provided localized name.

      This is useful when creating a ProgrammingMode deep within some system-specific code, and translations cannot be added to the top-level jmri.Bundle.

      Parameters:
      standardName - a name, not to be translated, for internal use
      localName - a localized, human-readable name for the mode
  • Method Details