|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractThrottleManager
jmri.jmrix.loconet.LnThrottleManager
public class LnThrottleManager
LocoNet implementation of a ThrottleManager.
Works in cooperation with the SlotManager, which actually handles the communications.
SlotManager| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jmri.jmrix.AbstractThrottleManager |
|---|
AbstractThrottleManager.Addresses |
| Constructor Summary | |
|---|---|
LnThrottleManager(SlotManager slotManager)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
addressTypeUnique()
Are there any ambiguous addresses (short vs long) on this system? |
boolean |
canBeLongAddress(int address)
Address 128 and above is a long address |
boolean |
canBeShortAddress(int address)
Address 127 and below is a short address |
void |
dispatchThrottle(DccThrottle t,
ThrottleListener l)
The throttle listener has finished with the specific Throttle and is is available for reuse/reallocation by somebody else. |
boolean |
disposeThrottle(DccThrottle t,
ThrottleListener l)
Not for general use, see releaseThrottle
and dispatchThrottle. |
boolean |
hasDispatchFunction()
LocoNet does have a Dispatch function |
void |
notifyChangedSlot(LocoNetSlot s)
SlotListener contract. |
void |
releaseThrottle(DccThrottle t,
ThrottleListener l)
The specified Throttle Listener has finished using a given throttle and no longer requires access to it. |
void |
requestThrottleSetup(LocoAddress address,
boolean control)
Start creating a Throttle object. |
protected boolean |
singleUse()
LocoNet allows multiple throttles for the same device |
| Methods inherited from class jmri.jmrix.AbstractThrottleManager |
|---|
addressReleased, addressStillRequired, attachListener, cancelThrottleRequest, cancelThrottleRequest, failedThrottleRequest, getThrottleInfo, notifyThrottleKnown, removeListener, requestThrottle, requestThrottle, requestThrottle, requestThrottleSetup, supportedSpeedModes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.ThrottleManager |
|---|
addressStillRequired, attachListener, cancelThrottleRequest, cancelThrottleRequest, getThrottleInfo, removeListener, requestThrottle, requestThrottle, requestThrottle, supportedSpeedModes |
| Constructor Detail |
|---|
public LnThrottleManager(SlotManager slotManager)
| Method Detail |
|---|
protected boolean singleUse()
singleUse in class AbstractThrottleManager
public void requestThrottleSetup(LocoAddress address,
boolean control)
requestThrottleSetup in class AbstractThrottleManagerpublic boolean hasDispatchFunction()
hasDispatchFunction in interface ThrottleManagerhasDispatchFunction in class AbstractThrottleManagerpublic void notifyChangedSlot(LocoNetSlot s)
notifyChangedSlot in interface SlotListenerpublic boolean canBeLongAddress(int address)
canBeLongAddress in interface ThrottleManagerpublic boolean canBeShortAddress(int address)
canBeShortAddress in interface ThrottleManagerpublic boolean addressTypeUnique()
addressTypeUnique in interface ThrottleManager
public boolean disposeThrottle(DccThrottle t,
ThrottleListener l)
ThrottleManagerreleaseThrottle
and dispatchThrottle.
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.
disposeThrottle in interface ThrottleManagerdisposeThrottle in class AbstractThrottleManagert - Throttle being releasedl - Throttle Listener releasing the throttle
public void dispatchThrottle(DccThrottle t,
ThrottleListener l)
ThrottleManagerNormally, dispatch ends with a call to dispose.
dispatchThrottle in interface ThrottleManagerdispatchThrottle in class AbstractThrottleManagert - Throttle being releasedl - Throttle Listener releasing the throttle
public void releaseThrottle(DccThrottle t,
ThrottleListener l)
ThrottleManagerAfter releasing the throttle, the manager will perform further checks to see if it is in use by any other listeners or if there are any propertychangelisteners attached. If there are no other uses of the throttle then it is disposed of.
Normally, release ends with a call to dispose.
releaseThrottle in interface ThrottleManagerreleaseThrottle in class AbstractThrottleManagert - Throttle being releasedl - Throttle Listener releasing the throttle
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||