Package jmri.jmris.srcp
Class JmriSRCPThrottleServer
- java.lang.Object
-
- jmri.jmris.AbstractThrottleServer
-
- jmri.jmris.srcp.JmriSRCPThrottleServer
-
- All Implemented Interfaces:
java.util.EventListener
,ThrottleListener
public class JmriSRCPThrottleServer extends AbstractThrottleServer
Interface between the JMRI Throttles and an SRCP network connection
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
JmriSRCPThrottleServer.SRCPThrottlePropertyChangeListener
-
Nested classes/interfaces inherited from interface jmri.ThrottleListener
ThrottleListener.DecisionType
-
-
Field Summary
-
Fields inherited from class jmri.jmris.AbstractThrottleServer
throttleList
-
-
Constructor Summary
Constructors Constructor Description JmriSRCPThrottleServer(java.io.DataInputStream inStream, java.io.OutputStream outStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initThrottle(int bus, int address, boolean isLong, int speedsteps, int functions)
void
notifyThrottleFound(DccThrottle t)
Get notification that a throttle has been found as requested.void
parsecommand(java.lang.String statusString)
void
releaseThrottle(int bus, int address)
void
sendErrorStatus()
void
sendStatus(int bus, int address)
void
sendStatus(LocoAddress l)
void
sendThrottleFound(LocoAddress address)
void
sendThrottleReleased(LocoAddress address)
void
setThrottleFunctions(int bus, int address, java.util.ArrayList<java.lang.Boolean> fList)
void
setThrottleSpeedAndDirection(int bus, int address, float speed, boolean isForward)
-
Methods inherited from class jmri.jmris.AbstractThrottleServer
notifyDecisionRequired, notifyFailedThrottleRequest, releaseThrottle, requestThrottle, setFunctionsByThrottle, setThrottleFunctions, setThrottleSpeedAndDirection
-
-
-
-
Constructor Detail
-
JmriSRCPThrottleServer
public JmriSRCPThrottleServer(java.io.DataInputStream inStream, java.io.OutputStream outStream)
-
-
Method Detail
-
sendStatus
public void sendStatus(LocoAddress l) throws java.io.IOException
- Specified by:
sendStatus
in classAbstractThrottleServer
- Throws:
java.io.IOException
-
sendStatus
public void sendStatus(int bus, int address) throws java.io.IOException
- Throws:
java.io.IOException
-
sendErrorStatus
public void sendErrorStatus() throws java.io.IOException
- Specified by:
sendErrorStatus
in classAbstractThrottleServer
- Throws:
java.io.IOException
-
parsecommand
public void parsecommand(java.lang.String statusString) throws JmriException, java.io.IOException
- Specified by:
parsecommand
in classAbstractThrottleServer
- Throws:
JmriException
java.io.IOException
-
sendThrottleFound
public void sendThrottleFound(LocoAddress address) throws java.io.IOException
- Specified by:
sendThrottleFound
in classAbstractThrottleServer
- Throws:
java.io.IOException
-
sendThrottleReleased
public void sendThrottleReleased(LocoAddress address) throws java.io.IOException
- Specified by:
sendThrottleReleased
in classAbstractThrottleServer
- Throws:
java.io.IOException
-
initThrottle
public void initThrottle(int bus, int address, boolean isLong, int speedsteps, int functions) throws java.io.IOException
- Throws:
java.io.IOException
-
releaseThrottle
public void releaseThrottle(int bus, int address) throws java.io.IOException
- Throws:
java.io.IOException
-
setThrottleSpeedAndDirection
public void setThrottleSpeedAndDirection(int bus, int address, float speed, boolean isForward)
-
setThrottleFunctions
public void setThrottleFunctions(int bus, int address, java.util.ArrayList<java.lang.Boolean> fList)
-
notifyThrottleFound
public void notifyThrottleFound(DccThrottle t)
Description copied from class:AbstractThrottleServer
Get notification that a throttle has been found as requested.- Specified by:
notifyThrottleFound
in interfaceThrottleListener
- Overrides:
notifyThrottleFound
in classAbstractThrottleServer
- Parameters:
t
- the throttle with the requested address
-
-