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
,UhlenbrockProgrammerManager
,XNetProgrammerManager
,Z21XNetProgrammerManager
public interface AddressedProgrammerManager extends PropertyChangeProvider
Get access to availableProgrammer
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 theInstanceManager
.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:
Programmer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description AddressedProgrammer
getAddressedProgrammer(boolean pLongAddress, int pAddress)
Gain access to a Addressed Mode Programmer without reservation.default AddressedProgrammer
getAddressedProgrammer(DccLocoAddress address)
Gain access to a Addressed Mode Programmer without reservation.java.util.List<ProgrammingMode>
getDefaultModes()
Get the list ofProgrammingMode
(generally) supported by Programmers provided by this Manager.java.lang.String
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.boolean
isAddressedModePossible()
Convenience method to check whether you'll be able to get an Addressed Mode programmer.boolean
isAddressedModePossible(LocoAddress address)
Convenience method to check whether you'll be able to get an Addressed Mode programmer for a specific addressvoid
releaseAddressedProgrammer(AddressedProgrammer p)
Return access to an Addressed Mode Programmer, so that it can be used elsewhere.AddressedProgrammer
reserveAddressedProgrammer(boolean pLongAddress, int pAddress)
Gain access to a (the) Addressed Mode Programmer, in the process reserving it for yourself.default AddressedProgrammer
reserveAddressedProgrammer(DccLocoAddress address)
Gain access to a (the) Addressed Mode Programmer, in the process reserving it for yourself.java.lang.String
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 Detail
-
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 falsepAddress
- specific decoder address to use- Returns:
- null only if there isn't an Ops Mode Programmer in the system
-
getAddressedProgrammer
@CheckForNull default AddressedProgrammer getAddressedProgrammer(@Nonnull DccLocoAddress address)
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 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
void releaseAddressedProgrammer(@Nonnull AddressedProgrammer p)
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
boolean isAddressedModePossible(@Nonnull LocoAddress address)
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
@Nonnull java.util.List<ProgrammingMode> 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
@Nonnull java.lang.String 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
@Nonnull java.lang.String 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 classjava.lang.Object
- Returns:
- the name for the programmer
-
-