Package jmri.jmrix.can.cbus
Class CbusDccProgrammerManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.managers.DefaultProgrammerManager
-
- jmri.jmrix.can.cbus.CbusDccProgrammerManager
-
- All Implemented Interfaces:
AddressedProgrammerManager
,PropertyChangeFirer
,PropertyChangeProvider
,GlobalProgrammerManager
public class CbusDccProgrammerManager extends DefaultProgrammerManager
Extend DefaultProgrammerManager to provide programmers for CBUS systems Added methods to manipulate the programmer availability to support hardware that can redirect ops mode or service mode packets to a particular interface.- See Also:
DefaultProgrammerManager
-
-
Field Summary
Fields Modifier and Type Field Description (package private) TrafficController
tc
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description CbusDccProgrammerManager(Programmer serviceModeProgrammer, CanSystemConnectionMemo 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.boolean
isAddressedModeHardwareAvailable()
CBUS DCC Programmer has hardware support for ops modeboolean
isAddressedModePossible()
Does Programmer currently support ops modeboolean
isGlobalProgrammerAvailable()
Programmer currently support service modeboolean
isGlobalProgrammerHardwareAvailable()
CBUS DCC Programmer has hardware support for service modevoid
mySetAddressedModePossible(boolean state)
Set availability of addressed (ops mode) programmer.void
mySetGlobalProgrammerAvailable(boolean state)
Set availability of global (service mode) programmer.AddressedProgrammer
reserveAddressedProgrammer(boolean pLongAddress, int pAddress)
Gain access to a (the) Addressed Mode Programmer, in the process reserving it for yourself.void
setAddressedModePossible(boolean state)
Set availability of addressed (ops mode) programmer.void
setGlobalProgrammerAvailable(boolean state)
Set availability of global (service mode) programmer.protected void
validateProgrammingModes(CanSystemConnectionMemo memo)
Check that the programming mode preferences, which may be default values for a new connection or if they have never been set, are consistent with the programmer modes for the connected hardware-
Methods inherited from class jmri.managers.DefaultProgrammerManager
dispose, getDefaultModes, getGlobalProgrammer, getUserName, isAddressedModePossible, releaseAddressedProgrammer, releaseGlobalProgrammer, 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
-
CbusDccProgrammerManager
public CbusDccProgrammerManager(Programmer serviceModeProgrammer, CanSystemConnectionMemo memo)
-
-
Method Detail
-
validateProgrammingModes
protected final void validateProgrammingModes(CanSystemConnectionMemo memo)
Check that the programming mode preferences, which may be default values for a new connection or if they have never been set, are consistent with the programmer modes for the connected hardware- Parameters:
memo
- CAN system connection emo
-
isAddressedModeHardwareAvailable
public boolean isAddressedModeHardwareAvailable()
CBUS DCC Programmer has hardware support for ops mode- Returns:
- true
-
isGlobalProgrammerHardwareAvailable
public boolean isGlobalProgrammerHardwareAvailable()
CBUS DCC Programmer has hardware support for service mode- Returns:
- true if available
-
isAddressedModePossible
public boolean isAddressedModePossible()
Does Programmer currently support ops mode- Specified by:
isAddressedModePossible
in interfaceAddressedProgrammerManager
- Overrides:
isAddressedModePossible
in classDefaultProgrammerManager
- Returns:
- true if possible
-
mySetAddressedModePossible
public final void mySetAddressedModePossible(boolean state)
Set availability of addressed (ops mode) programmer. To avoid calling overridable method from constructor- Parameters:
state
- true if possible
-
setAddressedModePossible
public void setAddressedModePossible(boolean state)
Set availability of addressed (ops mode) programmer.- Parameters:
state
- true if available
-
isGlobalProgrammerAvailable
public boolean isGlobalProgrammerAvailable()
Programmer currently support service mode- Specified by:
isGlobalProgrammerAvailable
in interfaceGlobalProgrammerManager
- Overrides:
isGlobalProgrammerAvailable
in classDefaultProgrammerManager
- Returns:
- true if available
-
mySetGlobalProgrammerAvailable
public final void mySetGlobalProgrammerAvailable(boolean state)
Set availability of global (service mode) programmer. To avoid calling overridable method from constructor- Parameters:
state
- true if available
-
setGlobalProgrammerAvailable
public void setGlobalProgrammerAvailable(boolean state)
Set availability of global (service mode) programmer.- Parameters:
state
- true if available
-
getAddressedProgrammer
public AddressedProgrammer getAddressedProgrammer(boolean pLongAddress, int pAddress)
Description copied from interface:AddressedProgrammerManager
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)
Description copied from interface:AddressedProgrammerManager
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
-
-