|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractThrottleManager
public abstract class AbstractThrottleManager
Abstract implementation of a ThrottleManager.
Based on Glen Oberhauser's original LnThrottleManager implementation.
| Constructor Summary | |
|---|---|
AbstractThrottleManager()
|
|
| Method Summary | |
|---|---|
void |
cancelThrottleRequest(int address,
boolean isLong,
ThrottleListener l)
Cancel a request for a throttle |
void |
cancelThrottleRequest(int address,
ThrottleListener l)
Cancel a request for a throttle. |
void |
failedThrottleRequest(DccLocoAddress address)
If the system-specific ThrottleManager has been unable to create the DCC throttle then it needs to be removed from the throttleListeners, otherwise any subsequent request for that address results in the address being reported as already in use, if singleUse is set. |
boolean |
hasDispatchFunction()
Check to see if the Dispatch Button should be enabled or not Default to true, override if necessary |
void |
notifyThrottleKnown(DccThrottle throttle,
LocoAddress addr)
Handle throttle information when it's finally available, e.g. when a new Throttle object has been created. |
boolean |
requestThrottle(int address,
boolean isLongAddress,
ThrottleListener l)
Request a throttle, given a decoder address. |
boolean |
requestThrottle(int address,
ThrottleListener l)
Request a throttle, given a decoder address. |
abstract void |
requestThrottleSetup(LocoAddress a)
Abstract member to actually do the work of configuring a new throttle, usually via interaction with the DCC system |
int |
supportedSpeedModes()
What speed modes are supported by this system? |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.ThrottleManager |
|---|
addressTypeUnique, canBeLongAddress, canBeShortAddress |
| Constructor Detail |
|---|
public AbstractThrottleManager()
| Method Detail |
|---|
public boolean requestThrottle(int address,
boolean isLongAddress,
ThrottleListener l)
requestThrottle in interface ThrottleManageraddress - The decoder address desired.isLongAddress - True if this is a request for a DCC long (extended) address.l - The ThrottleListener awaiting notification of a found throttle.
public boolean requestThrottle(int address,
ThrottleListener l)
This is a convenience version of the call, which uses system-specific logic to tell whether the address is a short or long form.
requestThrottle in interface ThrottleManageraddress - The decoder address desired.l - The ThrottleListener awaiting notification of a found throttle.
public abstract void requestThrottleSetup(LocoAddress a)
public void cancelThrottleRequest(int address,
boolean isLong,
ThrottleListener l)
cancelThrottleRequest in interface ThrottleManageraddress - The decoder address desired.isLong - True if this is a request for a DCC long (extended) address.l - The ThrottleListener cancelling request for a throttle.
public void cancelThrottleRequest(int address,
ThrottleListener l)
This is a convenience version of the call, which uses system-specific logic to tell whether the address is a short or long form.
cancelThrottleRequest in interface ThrottleManageraddress - The decoder address desired.l - The ThrottleListener cancelling request for a throttle.public void failedThrottleRequest(DccLocoAddress address)
address - The DCC Loco Address that the request failed on.
public void notifyThrottleKnown(DccThrottle throttle,
LocoAddress addr)
This method creates a throttle for all ThrottleListeners of that address and notifies them via the ThrottleListener.notifyThrottleFound method.
public boolean hasDispatchFunction()
hasDispatchFunction in interface ThrottleManagerpublic int supportedSpeedModes()
supportedSpeedModes in interface ThrottleManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||