Package jmri.jmrix.lenz
Class XNetThrottleManager
java.lang.Object
jmri.jmrix.AbstractThrottleManager
jmri.jmrix.lenz.XNetThrottleManager
- All Implemented Interfaces:
EventListener,AbstractMRListener,XNetListener,ThrottleManager
- Direct Known Subclasses:
EliteXNetThrottleManager,RocoXNetThrottleManager
XNet implementation of a ThrottleManager based on the
AbstractThrottleManager.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrix.AbstractThrottleManager
AbstractThrottleManager.Addresses -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected XNetTrafficControllerprotected final HashMap<LocoAddress,XNetThrottle> Fields inherited from class jmri.jmrix.AbstractThrottleManager
adapterMemo, userName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAre there any ambiguous addresses (short vs long) on this system?booleancanBeLongAddress(int address) Address 100 and above is a long address.booleancanBeShortAddress(int address) Address 99 and below is a short address.booleanNot for general use, seereleaseThrottleanddispatchThrottle.booleanXpressNet based systems DO NOT use the Dispatch Function.protected static booleanisLongAddress(int num) Local method for deciding short/long addressvoidListen for the messages to the LI100/LI101.voidHandle incoming messages for throttles.voidnotifyTimeout(XNetMessage msg) Handle a timeout notification.voidrequestThrottleSetup(LocoAddress address, boolean control) Request a new throttle object be created for the address, and let the throttle listeners know about it.protected booleanXpressNet based systems can have multiple throttles for the same device.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, 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, updateNumUsers
-
Field Details
-
throttles
-
tc
-
-
Constructor Details
-
XNetThrottleManager
Constructor.- Parameters:
memo- system connection.
-
-
Method Details
-
requestThrottleSetup
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:
requestThrottleSetupin classAbstractThrottleManager- Parameters:
address- addresscontrol- false - read only.
-
hasDispatchFunction
XpressNet based systems DO NOT use the Dispatch Function.- Specified by:
hasDispatchFunctionin interfaceThrottleManager- Overrides:
hasDispatchFunctionin classAbstractThrottleManager- Returns:
- false always.
-
singleUse
XpressNet based systems can have multiple throttles for the same device.Does this DCC system allow a Throttle (e.g. an address) to be used by only one user at a time?
- Overrides:
singleUsein classAbstractThrottleManager- Returns:
- true or false
-
canBeLongAddress
Address 100 and above is a long address.- Specified by:
canBeLongAddressin interfaceThrottleManager- Parameters:
address- address number to test- Returns:
- true if address can be long; false otherwise
-
canBeShortAddress
Address 99 and below is a short address.- Specified by:
canBeShortAddressin interfaceThrottleManager- Parameters:
address- address number to test- Returns:
- true if address can be short; false otherwise
-
addressTypeUnique
Are there any ambiguous addresses (short vs long) on this system?- Specified by:
addressTypeUniquein interfaceThrottleManager- Returns:
- true if ambiguous addresses are not allowed; false otherwise
-
isLongAddress
Local method for deciding short/long address- Parameters:
num- address to examine- Returns:
- true if can be long address
-
supportedSpeedModes
What speed modes are supported by this system? value should be xor of possible modes specifed by the DccThrottle interface XpressNet supports 14,27,28 and 128 speed step modes- Specified by:
supportedSpeedModesin interfaceThrottleManager- Overrides:
supportedSpeedModesin classAbstractThrottleManager- Returns:
- an XOR of the possible modes specified in the throttle interface
-
message
Handle incoming messages for throttles.- Specified by:
messagein interfaceXNetListener- Parameters:
r- The received XNet message. Note that this same object may be presented to multiple users. It should not be modified here.
-
message
Listen for the messages to the LI100/LI101.- Specified by:
messagein interfaceXNetListener- Parameters:
l- The received XNet message. Note that this same object may be presented to multiple users. It should not be modified here.
-
notifyTimeout
Handle a timeout notification.- Specified by:
notifyTimeoutin interfaceXNetListener- Parameters:
msg- message which has timed out.
-
disposeThrottle
Description copied from class:AbstractThrottleManagerNot for general use, seereleaseThrottleanddispatchThrottle.Dispose of object when finished it. This will free up hardware resource
Used for handling certain internal error conditions, where the object still exists but hardware is not associated with it.
After this, further usage of this Throttle object will result in a JmriException.
- Specified by:
disposeThrottlein interfaceThrottleManager- Overrides:
disposeThrottlein classAbstractThrottleManager- Parameters:
t- Throttle being releasedl- Throttle Listener releasing the throttle- Returns:
- true if the throttle has been disposed of.
-