|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractThrottleManager
jmri.jmrix.lenz.XNetThrottleManager
public class XNetThrottleManager
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 | |
|---|---|
(package private) static org.slf4j.Logger |
log
|
protected XNetTrafficController |
tc
|
protected HashMap<LocoAddress,XNetThrottle> |
throttles
|
| Fields inherited from class jmri.jmrix.AbstractThrottleManager |
|---|
adapterMemo, userName |
| Constructor Summary | |
|---|---|
XNetThrottleManager(XNetSystemConnectionMemo memo)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
addressTypeUnique()
Are there any ambiguous addresses (short vs long) on this system? |
boolean |
canBeLongAddress(int address)
Address 100 and above is a long address |
boolean |
canBeShortAddress(int address)
Address 99 and below is a short address |
boolean |
disposeThrottle(DccThrottle t,
ThrottleListener l)
Not for general use, see releaseThrottle
and dispatchThrottle. |
boolean |
hasDispatchFunction()
Check to see if the Dispatch Button should be enabled or not Default to true, override if necessary |
(package private) static boolean |
isLongAddress(int num)
|
void |
message(XNetMessage l)
Member function that will be invoked by a XNetInterface implementation to forward a XNet message sent to the layout. |
void |
message(XNetReply r)
Member function that will be invoked by a XNetInterface implementation to forward a XNet message from the layout. |
void |
notifyTimeout(XNetMessage msg)
Member function invoked by an XNetInterface implementation to notify * a sender that an outgoing message timed out and was dropped from the * queue. |
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)
Request a new throttle object be creaetd for the address, and let the throttle listeners know about it. |
protected boolean |
singleUse()
Does this DCC system allow a Throttle (e.g. an address) to be used by only one user at a time? |
int |
supportedSpeedModes()
What speed modes are supported by this system? |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected HashMap<LocoAddress,XNetThrottle> throttles
protected XNetTrafficController tc
static org.slf4j.Logger log
| Constructor Detail |
|---|
public XNetThrottleManager(XNetSystemConnectionMemo memo)
| Method Detail |
|---|
public void requestThrottleSetup(LocoAddress address,
boolean control)
requestThrottleSetup in class AbstractThrottleManagerpublic boolean hasDispatchFunction()
AbstractThrottleManager
hasDispatchFunction in interface ThrottleManagerhasDispatchFunction in class AbstractThrottleManagerprotected boolean singleUse()
AbstractThrottleManager
singleUse in class AbstractThrottleManagerpublic boolean canBeLongAddress(int address)
canBeLongAddress in interface ThrottleManagerpublic boolean canBeShortAddress(int address)
canBeShortAddress in interface ThrottleManagerpublic boolean addressTypeUnique()
addressTypeUnique in interface ThrottleManagerstatic boolean isLongAddress(int num)
public int supportedSpeedModes()
supportedSpeedModes in interface ThrottleManagersupportedSpeedModes in class AbstractThrottleManagerpublic void message(XNetReply r)
XNetListener
message in interface XNetListenerr - The received XNet message. Note that this same object
may be presented to multiple users. It should not be
modified here.public void message(XNetMessage l)
XNetListener
message in interface XNetListenerl - The received XNet message. Note that this same object
may be presented to multiple users. It should not be
modified here.public void notifyTimeout(XNetMessage msg)
XNetListener
notifyTimeout in interface XNetListener
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
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||