Package jmri.jmrix.loconet.uhlenbrock
Class UhlenbrockLnThrottleManager
- java.lang.Object
-
- jmri.jmrix.AbstractThrottleManager
-
- jmri.jmrix.loconet.LnThrottleManager
-
- jmri.jmrix.loconet.uhlenbrock.UhlenbrockLnThrottleManager
-
- All Implemented Interfaces:
java.util.EventListener
,SlotListener
,ThrottleManager
public class UhlenbrockLnThrottleManager extends LnThrottleManager
LocoNet implementation of a ThrottleManager for Uhlenbrock.Works in cooperation with the SlotManager, which actually handles the communications.
- See Also:
SlotManager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrix.loconet.LnThrottleManager
LnThrottleManager.ThrottleRequest
-
Nested classes/interfaces inherited from class jmri.jmrix.AbstractThrottleManager
AbstractThrottleManager.Addresses
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Hashtable<java.lang.Integer,java.lang.Thread>
waitingForNotification
-
Fields inherited from class jmri.jmrix.loconet.LnThrottleManager
slotManager, tc, throttleID
-
Fields inherited from class jmri.jmrix.AbstractThrottleManager
adapterMemo, userName
-
-
Constructor Summary
Constructors Constructor Description UhlenbrockLnThrottleManager(UhlenbrockSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelThrottleRequest(LocoAddress address, ThrottleListener l)
Cancel a request for a throttle.void
failedThrottleRequest(LocoAddress address, java.lang.String reason)
Cancels the loco acquisition process when throttle acquisition of a loco fails.void
notifyChangedSlot(LocoNetSlot s)
SlotListener contract.void
requestThrottleSetup(LocoAddress address, boolean control)
The Intellibox-II doesn't always respond to a request loco message, therefore the system will not allow further requests to create a throttle to that address as one is already in process.-
Methods inherited from class jmri.jmrix.loconet.LnThrottleManager
addressTypeUnique, canBeLongAddress, canBeShortAddress, dispatchThrottle, dispose, disposeThrottle, enablePrefSilentStealOption, getThrottleID, hasDispatchFunction, isLongAddress, notifyComplete, notifyRefused, notifyStealRequest, processQueuedThrottleSetupRequest, releaseThrottle, responseThrottleDecision, singleUse, supportedSpeedModes
-
Methods inherited from class jmri.jmrix.AbstractThrottleManager
addressReleased, addressStillRequired, addressStillRequired, addressStillRequired, addressStillRequired, attachListener, cancelThrottleRequest, cancelThrottleRequest, cancelThrottleRequest, enablePrefSilentShareOption, forceDisposeThrottle, getAddress, getAddress, getAddressProtocolTypes, getAddressTypes, getAddressTypeString, getProtocolFromString, getThrottleInfo, getThrottleUsageCount, getThrottleUsageCount, getThrottleUsageCount, getThrottleUsageCount, getUserName, hideStealNotifications, makeHardwareDecision, notifyDecisionRequest, notifyThrottleKnown, removeListener, requestThrottle, requestThrottle, requestThrottle, requestThrottle, requestThrottle, requestThrottle, requestThrottleSetup, responseThrottleDecision, responseThrottleDecision, showSessionCancelDialogue, updateNumUsers
-
-
-
-
Field Detail
-
waitingForNotification
java.util.Hashtable<java.lang.Integer,java.lang.Thread> waitingForNotification
-
-
Constructor Detail
-
UhlenbrockLnThrottleManager
public UhlenbrockLnThrottleManager(UhlenbrockSystemConnectionMemo memo)
-
-
Method Detail
-
requestThrottleSetup
public void requestThrottleSetup(LocoAddress address, boolean control)
The Intellibox-II doesn't always respond to a request loco message, therefore the system will not allow further requests to create a throttle to that address as one is already in process. With the Intellibox throttle, it will make three attempts to connect if no response is received from the command station after 2 seconds. Otherwise it will send a failthrottlerequest message out.- Overrides:
requestThrottleSetup
in classLnThrottleManager
- Parameters:
address
- locomotive address to be controlledcontrol
- true if throttle wishes to control the speed and direction of the loco.
-
notifyChangedSlot
public void notifyChangedSlot(LocoNetSlot s)
SlotListener contract. Get notification that an address has changed slot. This method creates a throttle for all ThrottleListeners of that address and notifies them via the ThrottleListener.notifyThrottleFound method.- Specified by:
notifyChangedSlot
in interfaceSlotListener
- Overrides:
notifyChangedSlot
in classLnThrottleManager
- Parameters:
s
- LocoNet slot which has been changed
-
failedThrottleRequest
public void failedThrottleRequest(LocoAddress address, java.lang.String reason)
Description copied from class:LnThrottleManager
Cancels the loco acquisition process when throttle acquisition of a loco fails.- Overrides:
failedThrottleRequest
in classLnThrottleManager
- Parameters:
address
- loco address which could not be acquiredreason
- for the failure
-
cancelThrottleRequest
public void cancelThrottleRequest(LocoAddress address, ThrottleListener l)
Cancel a request for a throttle.- Specified by:
cancelThrottleRequest
in interfaceThrottleManager
- Overrides:
cancelThrottleRequest
in classLnThrottleManager
- Parameters:
address
- The decoder address desired.l
- The ThrottleListener cancelling request for a throttle.
-
-