Package jmri.jmrix.direct
Class ThrottleManager
java.lang.Object
jmri.jmrix.AbstractThrottleManager
jmri.jmrix.direct.ThrottleManager
- All Implemented Interfaces:
ThrottleManager
Direct DCC implementation of a ThrottleManager.
When the traffic manager doesn't have anything else to do, it comes here to get a command to send.
This is a partial implementation, which can only handle one Throttle at a time. It also is missing logic to alternate sending speed and function commands; right now it only sends the first group of function packets.
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.jmrix.AbstractThrottleManager
AbstractThrottleManager.Addresses -
Field Summary
FieldsFields inherited from class jmri.jmrix.AbstractThrottleManager
adapterMemo, userName -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for a Direct ThrottleManager. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest if ambiguous addresses (short vs long) are not allowed on this system.booleancanBeLongAddress(int a) Test if a specific number is a valid long address on this system.booleancanBeShortAddress(int a) Test if a specific number is a valid short address on this system.booleanInvoked when a throttle is released, this updates the local data structures.voidrequestThrottleSetup(LocoAddress address, boolean control) Create throttle data structures.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, hasDispatchFunction, hideStealNotifications, makeHardwareDecision, notifyDecisionRequest, notifyThrottleKnown, releaseThrottle, removeListener, requestThrottle, requestThrottle, requestThrottle, requestThrottle, requestThrottle, requestThrottle, requestThrottleSetup, responseThrottleDecision, responseThrottleDecision, responseThrottleDecision, showSessionCancelDialogue, singleUse, supportedSpeedModes, updateNumUsers
-
Field Details
-
currentThrottle
-
-
Constructor Details
-
ThrottleManager
Constructor for a Direct ThrottleManager.- Parameters:
memo- system connection.
-
-
Method Details
-
requestThrottleSetup
Create throttle data structures. 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.
-
addressTypeUnique
Description copied from interface:ThrottleManagerTest if ambiguous addresses (short vs long) are not allowed on this system. Also indicates support for multi-protocol decoders.- Returns:
- true if ambiguous addresses are not allowed; false otherwise
-
canBeShortAddress
Description copied from interface:ThrottleManagerTest if a specific number is a valid short address on this system.- Parameters:
a- address number to test- Returns:
- true if address can be short; false otherwise
-
canBeLongAddress
Description copied from interface:ThrottleManagerTest if a specific number is a valid long address on this system.- Parameters:
a- address number to test- Returns:
- true if address can be long; false otherwise
-
disposeThrottle
Invoked when a throttle is released, this updates the local data structures.- 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.
-