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
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.
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 Summary
Modifier and TypeMethodDescriptiongetAddressedProgrammer(boolean pLongAddress, int pAddress) Gain access to a Addressed Mode Programmer without reservation.default AddressedProgrammergetAddressedProgrammer(DccLocoAddress address) Gain access to a Addressed Mode Programmer without reservation.Get the list ofProgrammingMode(generally) supported by Programmers provided by this Manager.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.booleanConvenience method to check whether you'll be able to get an Addressed Mode programmer.booleanisAddressedModePossible(LocoAddress address) Convenience method to check whether you'll be able to get an Addressed Mode programmer for a specific addressvoidReturn access to an Addressed Mode Programmer, so that it can be used elsewhere.reserveAddressedProgrammer(boolean pLongAddress, int pAddress) Gain access to a (the) Addressed Mode Programmer, in the process reserving it for yourself.default AddressedProgrammerreserveAddressedProgrammer(DccLocoAddress address) Gain access to a (the) Addressed Mode Programmer, in the process reserving it for yourself.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.Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Method Details
-
getAddressedProgrammer
Gain access to a Addressed Mode Programmer without reservation.- Parameters:
pLongAddress- true if this is a long (14 bit) address, else falsepAddress- 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
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 falsepAddress- Specific decoder address to use- Returns:
- null if the address is in use by a reserved programmer
-
reserveAddressedProgrammer
@CheckForNull default AddressedProgrammer reserveAddressedProgrammer(@Nonnull DccLocoAddress address) 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
boolean 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 ofProgrammingMode(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.
-