Package jmri.jmris
Class AbstractThrottleServer
java.lang.Object
jmri.jmris.AbstractThrottleServer
- All Implemented Interfaces:
EventListener,ThrottleListener
- Direct Known Subclasses:
JmriSRCPThrottleServer
Abstract interface between the JMRI Throttles and a network connection
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classNested classes/interfaces inherited from interface jmri.ThrottleListener
ThrottleListener.DecisionType -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidnotifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question) No steal or share decisions made locallyvoidnotifyFailedThrottleRequest(LocoAddress address, String reason) Get notification that an attempt to request a throttle has failed.voidGet notification that a throttle has been found as requested.abstract voidparsecommand(String statusString) voidvoidabstract voidabstract voidsendStatus(LocoAddress address) abstract voidsendThrottleFound(LocoAddress address) abstract voidsendThrottleReleased(LocoAddress address) protected voidsetFunctionsByThrottle(Throttle t, ArrayList<Boolean> fList) Set Throttle Functions on/off.voidsetThrottleFunctions(LocoAddress l, ArrayList<Boolean> fList) Set Throttle Functions on/off.voidsetThrottleSpeedAndDirection(LocoAddress l, float speed, boolean isForward)
-
Field Details
-
throttleList
-
-
Constructor Details
-
AbstractThrottleServer
public AbstractThrottleServer()
-
-
Method Details
-
sendStatus
- Throws:
IOException
-
sendErrorStatus
- Throws:
IOException
-
sendThrottleFound
- Throws:
IOException
-
sendThrottleReleased
- Throws:
IOException
-
parsecommand
- Throws:
JmriExceptionIOException
-
setThrottleSpeedAndDirection
-
setThrottleFunctions
Set Throttle Functions on/off.- Parameters:
l- LocoAddress of the locomotive to change speed of.fList- an ArrayList of boolean values indicating whether the function is active or not.
-
setFunctionsByThrottle
Set Throttle Functions on/off.- Parameters:
t- Throttle to change speed of.fList- an ArrayList of boolean values indicating whether the function is active or not.
-
requestThrottle
-
releaseThrottle
-
notifyThrottleFound
Get notification that a throttle has been found as requested.- Specified by:
notifyThrottleFoundin interfaceThrottleListener- Parameters:
t- the throttle with the requested address
-
notifyFailedThrottleRequest
Get notification that an attempt to request a throttle has failed.- Specified by:
notifyFailedThrottleRequestin interfaceThrottleListener- Parameters:
address- address of the failed requestreason- failure cause
-
notifyDecisionRequired
No steal or share decisions made locallyGet notification that a throttle request is in use by another device, and a "steal", "share", or "steal/share" decision may be required.
- Specified by:
notifyDecisionRequiredin interfaceThrottleListener- Parameters:
address- The LocoAddress that needs the decision.question- The question being asked, steal / cancel, share / cancel, steal / share / cancel
-