Package jmri

Interface AddressedProgrammerManager

All Superinterfaces:
PropertyChangeProvider
All Known Implementing Classes:
BiDiBProgrammerManager, CbusDccProgrammerManager, Dcc4PcProgrammerManager, DCCppProgrammerManager, DebugProgrammerManager, DefaultProgrammerManager, DeferringProgrammerManager, EasyDccProgrammerManager, EcosProgrammerManager, LnProgrammerManager, MrcProgrammerManager, Mx1ProgrammerManager, NceProgrammerManager, OlcbProgrammerManager, SprogProgrammerManager, SRCPProgrammerManager, TamsProgrammerManager, TmccProgrammerManager, UhlenbrockProgrammerManager, XNetProgrammerManager, Z21XNetProgrammerManager

Get access to available Programmer objects.

Programmers come in two types:

  • Global, previously "Service Mode" or on a programming track. Request these from an instance of GlobalProgrammerManager.
  • Addressed, previously "Ops Mode" also known as "programming on the main". Request these from an instance of this interface.
You get a Programmer object from a ProgrammerManager, which in turn can be located from the InstanceManager.

This interface also provides a reserve/release system for tools that want to pretend they have exclusive use of a Programmer. This is a cooperative reservation; both tools (first and second reserver) must be using the reserve/release interface.

This file is part of JMRI.

JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Since:
3.9.6
See Also:
  • Method Details

    • getAddressedProgrammer

      @CheckForNull AddressedProgrammer getAddressedProgrammer(boolean pLongAddress, int pAddress)
      Gain access to a Addressed Mode Programmer without reservation.
      Parameters:
      pLongAddress - true if this is a long (14 bit) address, else false
      pAddress - specific decoder address to use
      Returns:
      null only if there isn't an Ops Mode Programmer in the system
    • getAddressedProgrammer

      Gain access to a Addressed Mode Programmer without reservation.
      Parameters:
      address - specific decoder address to use
      Returns:
      null only if there isn't an Ops Mode Programmer in the system
    • reserveAddressedProgrammer

      @CheckForNull AddressedProgrammer reserveAddressedProgrammer(boolean pLongAddress, int pAddress)
      Gain access to a (the) Addressed Mode Programmer, in the process reserving it for yourself.
      Parameters:
      pLongAddress - true if this is a long (14 bit) address, else false
      pAddress - Specific decoder address to use
      Returns:
      null if the address is in use by a reserved programmer
    • reserveAddressedProgrammer

      Gain access to a (the) Addressed Mode Programmer, in the process reserving it for yourself.
      Parameters:
      address - specific decoder address to use
      Returns:
      null if the address is in use by a reserved programmer
    • releaseAddressedProgrammer

      Return access to an Addressed Mode Programmer, so that it can be used elsewhere.
      Parameters:
      p - the programmer to release
    • isAddressedModePossible

      Convenience method to check whether you'll be able to get an Addressed Mode programmer.
      Returns:
      false if there's no chance of getting one
    • isAddressedModePossible

      Convenience method to check whether you'll be able to get an Addressed Mode programmer for a specific address
      Parameters:
      address - the address to get a programmer for
      Returns:
      false if there's no chance of getting one
    • getDefaultModes

      Get the list of ProgrammingMode (generally) supported by Programmers provided by this Manager.

      Use this to enquire about modes before you're ready to request a specific programmer.

      If the order is significant, earlier modes are better.

      Returns:
      the programming modes or an empty list
    • getUserName

      Provides the human-readable representation for including ProgrammerManagers directly in user interface controls, so it should return a user-provided name for this particular one.
      Returns:
      the name for the programmer
    • toString

      Provides the human-readable representation for including ProgrammerManagers directly in user interface controls, so it should return a user-provided name for this particular one.
      Overrides:
      toString in class Object
      Returns:
      the name for the programmer