Package jmri.jmrix.bidib
Class BiDiBProgrammerManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.managers.DefaultProgrammerManager
-
- jmri.jmrix.bidib.BiDiBProgrammerManager
-
- All Implemented Interfaces:
AddressedProgrammerManager
,PropertyChangeFirer
,PropertyChangeProvider
,GlobalProgrammerManager
public class BiDiBProgrammerManager extends DefaultProgrammerManager
Extend DefaultProgrammerManager to provide ops mode programmers for BiDiB systems- See Also:
GlobalProgrammerManager
-
-
Field Summary
Fields Modifier and Type Field Description (package private) BiDiBSystemConnectionMemo
memo
(package private) BiDiBTrafficController
tc
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description BiDiBProgrammerManager(BiDiBSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AddressedProgrammer
getAddressedProgrammer(boolean pLongAddress, int pAddress)
Gain access to a Addressed Mode Programmer without reservation.Programmer
getGlobalProgrammer()
Gain access to the Global Mode Programmer without reservation.boolean
isAddressedModePossible()
Convenience method to check whether you'll be able to get an Addressed Mode programmer.boolean
isGlobalProgrammerAvailable()
Convenience method to check whether you'll be able to get a Global Mode programmer.void
releaseAddressedProgrammer(AddressedProgrammer p)
Return access to an Addressed Mode Programmer, so that it can be used elsewhere.void
releaseGlobalProgrammer(Programmer p)
Return access to the Global 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.-
Methods inherited from class jmri.managers.DefaultProgrammerManager
dispose, getDefaultModes, getUserName, isAddressedModePossible, reserveGlobalProgrammer, toString
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.AddressedProgrammerManager
getAddressedProgrammer, reserveAddressedProgrammer
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Constructor Detail
-
BiDiBProgrammerManager
public BiDiBProgrammerManager(@Nonnull BiDiBSystemConnectionMemo memo)
-
-
Method Detail
-
isAddressedModePossible
public boolean isAddressedModePossible()
Convenience method to check whether you'll be able to get an Addressed Mode programmer.- Specified by:
isAddressedModePossible
in interfaceAddressedProgrammerManager
- Overrides:
isAddressedModePossible
in classDefaultProgrammerManager
- Returns:
- true if selected BiDiB hardware and connection type support Ops Mode
-
isGlobalProgrammerAvailable
public boolean isGlobalProgrammerAvailable()
Convenience method to check whether you'll be able to get a Global Mode programmer.- Specified by:
isGlobalProgrammerAvailable
in interfaceGlobalProgrammerManager
- Overrides:
isGlobalProgrammerAvailable
in classDefaultProgrammerManager
- Returns:
- true if selected BiDiB hardware and connection type support Service Mode
-
getGlobalProgrammer
public Programmer getGlobalProgrammer()
Gain access to the Global Mode Programmer without reservation.- Specified by:
getGlobalProgrammer
in interfaceGlobalProgrammerManager
- Overrides:
getGlobalProgrammer
in classDefaultProgrammerManager
- Returns:
- null only if there isn't a Global Mode Programmer available via this Manager.
-
getAddressedProgrammer
public AddressedProgrammer getAddressedProgrammer(boolean pLongAddress, int pAddress)
Gain access to a Addressed Mode Programmer without reservation.- Specified by:
getAddressedProgrammer
in interfaceAddressedProgrammerManager
- Overrides:
getAddressedProgrammer
in classDefaultProgrammerManager
- 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
-
reserveAddressedProgrammer
public AddressedProgrammer reserveAddressedProgrammer(boolean pLongAddress, int pAddress)
Gain access to a (the) Addressed Mode Programmer, in the process reserving it for yourself.- Specified by:
reserveAddressedProgrammer
in interfaceAddressedProgrammerManager
- Overrides:
reserveAddressedProgrammer
in classDefaultProgrammerManager
- 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
-
releaseGlobalProgrammer
public void releaseGlobalProgrammer(@Nonnull Programmer p)
Return access to the Global Mode Programmer, so that it can be used elsewhere.- Specified by:
releaseGlobalProgrammer
in interfaceGlobalProgrammerManager
- Overrides:
releaseGlobalProgrammer
in classDefaultProgrammerManager
- Parameters:
p
- the Programmer to release
-
releaseAddressedProgrammer
public void releaseAddressedProgrammer(@Nonnull AddressedProgrammer p)
Return access to an Addressed Mode Programmer, so that it can be used elsewhere.- Specified by:
releaseAddressedProgrammer
in interfaceAddressedProgrammerManager
- Overrides:
releaseAddressedProgrammer
in classDefaultProgrammerManager
- Parameters:
p
- the programmer to release
-
-