Package jmri.jmrix.xpa
Class XpaThrottleManager
- java.lang.Object
-
- jmri.jmrix.AbstractThrottleManager
-
- jmri.jmrix.xpa.XpaThrottleManager
-
- All Implemented Interfaces:
ThrottleManager
public class XpaThrottleManager extends AbstractThrottleManager
XPA implementation of a ThrottleManager.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrix.AbstractThrottleManager
AbstractThrottleManager.Addresses
-
-
Field Summary
-
Fields inherited from class jmri.jmrix.AbstractThrottleManager
adapterMemo, userName
-
-
Constructor Summary
Constructors Constructor Description XpaThrottleManager(XpaSystemConnectionMemo m)
Create a throttle manager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addressTypeUnique()
Test if ambiguous addresses (short vs long) are not allowed on this system.boolean
canBeLongAddress(int address)
Test if a specific number is a valid long address on this system.boolean
canBeShortAddress(int address)
Test if a specific number is a valid short address on this system.boolean
hasDispatchFunction()
The XPA does not support the dispatch function.(package private) static boolean
isLongAddress(int num)
Local method for deciding short/long address.void
requestThrottleSetup(LocoAddress address, boolean control)
Request a new throttle object be created for the address, and let the throttle listeners know about it.java.util.EnumSet<SpeedStepMode>
supportedSpeedModes()
What speed modes are supported by this system?-
Methods inherited from class jmri.jmrix.AbstractThrottleManager
addressReleased, addressStillRequired, addressStillRequired, addressStillRequired, addressStillRequired, attachListener, cancelThrottleRequest, cancelThrottleRequest, cancelThrottleRequest, cancelThrottleRequest, dispatchThrottle, dispose, disposeThrottle, enablePrefSilentShareOption, enablePrefSilentStealOption, failedThrottleRequest, forceDisposeThrottle, getAddress, getAddress, getAddressProtocolTypes, getAddressTypes, getAddressTypeString, getProtocolFromString, getThrottleInfo, getThrottleUsageCount, getThrottleUsageCount, getThrottleUsageCount, getThrottleUsageCount, getUserName, hideStealNotifications, makeHardwareDecision, notifyDecisionRequest, notifyThrottleKnown, releaseThrottle, removeListener, requestThrottle, requestThrottle, requestThrottle, requestThrottle, requestThrottle, requestThrottle, requestThrottleSetup, responseThrottleDecision, responseThrottleDecision, responseThrottleDecision, showSessionCancelDialogue, singleUse, updateNumUsers
-
-
-
-
Constructor Detail
-
XpaThrottleManager
public XpaThrottleManager(XpaSystemConnectionMemo m)
Create a throttle manager.- Parameters:
m
- the memo for the connection the manager is associated with
-
-
Method Detail
-
requestThrottleSetup
public void requestThrottleSetup(LocoAddress address, boolean control)
Request a new throttle object be created for the address, and let the throttle listeners know about it. Abstract member to actually do the work of configuring a new throttle, usually via interaction with the DCC system.- Specified by:
requestThrottleSetup
in classAbstractThrottleManager
- Parameters:
address
- addresscontrol
- false - read only.
-
hasDispatchFunction
public boolean hasDispatchFunction()
The XPA does not support the dispatch function.- Specified by:
hasDispatchFunction
in interfaceThrottleManager
- Overrides:
hasDispatchFunction
in classAbstractThrottleManager
- Returns:
- false
-
canBeLongAddress
public boolean canBeLongAddress(int address)
Test if a specific number is a valid long address on this system. Address 100 and above is a long address.- Parameters:
address
- address number to test- Returns:
- true if address can be long; false otherwise
-
canBeShortAddress
public boolean canBeShortAddress(int address)
Test if a specific number is a valid short address on this system. Address 99 and below is a short address.- Parameters:
address
- address number to test- Returns:
- true if address can be short; false otherwise
-
addressTypeUnique
public boolean addressTypeUnique()
Test if ambiguous addresses (short vs long) are not allowed on this system. Also indicates support for multi-protocol decoders.- Returns:
- true because this type of throttle has no long/short overlap
-
isLongAddress
static boolean isLongAddress(int num)
Local method for deciding short/long address.- Parameters:
num
- address to check- Returns:
- true if valid as long address
-
supportedSpeedModes
public java.util.EnumSet<SpeedStepMode> supportedSpeedModes()
What speed modes are supported by this system? value should be xor of possible modes specifed by the DccThrottle interface- Specified by:
supportedSpeedModes
in interfaceThrottleManager
- Overrides:
supportedSpeedModes
in classAbstractThrottleManager
- Returns:
- an XOR of the possible modes specified in the throttle interface
-
-