|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrit.withrottle.ThrottleController
public class ThrottleController
| Field Summary | |
|---|---|
protected ArrayList<ControllerInterface> |
controllerListeners
|
protected ArrayList<ThrottleControllerListener> |
listeners
|
| Constructor Summary | |
|---|---|
ThrottleController()
|
|
ThrottleController(char whichThrottleChar,
ThrottleControllerListener tcl,
ControllerInterface cl)
|
|
| Method Summary | |
|---|---|
void |
addControllerListener(ControllerInterface listener)
Add a listener to handle: listener.sendPacketToDevice(message); |
void |
addressDispatch()
|
void |
addressRelease()
Receive notification that an address has been released/dispatched |
void |
addThrottleControllerListener(ThrottleControllerListener l)
|
protected String |
buildFStatesHeader()
|
protected void |
eStop()
|
RosterEntry |
findRosterEntry(DccThrottle t)
|
protected void |
forceFunction(String inPackage)
|
DccLocoAddress |
getCurrentAddress()
|
String |
getCurrentAddressString()
Get the string representation of this throttles address. |
DccThrottle |
getFunctionThrottle()
|
DccThrottle |
getThrottle()
|
protected void |
handleFunction(String inPackage)
|
protected void |
handleMomentary(String inPackage)
|
protected void |
handleRequest(String inPackage)
|
protected void |
handleSpeedStepMode(int newMode)
|
protected void |
idle()
|
void |
notifyFailedThrottleRequest(DccLocoAddress address,
String reason)
Get notification that an attempt to request a throttle has failed |
void |
notifyThrottleFound(DccThrottle t)
Recieve notification that a DccThrottle has been found and is in use. |
void |
propertyChange(PropertyChangeEvent event)
|
void |
removeControllerListener(ControllerInterface listener)
|
void |
removeThrottleControllerListener(ThrottleControllerListener l)
|
void |
requestEntryFromID(String id)
|
void |
sendAddress()
|
void |
sendAllFunctionStates(DccThrottle t)
send all function states, primarily for initial status Current Format: RPF}|{whichThrottle]\[function}|{state]\[function}|{state... |
protected void |
sendAllMomentaryStates(DccThrottle t)
|
protected void |
sendCurrentDirection(DccThrottle t)
|
protected void |
sendCurrentSpeed(DccThrottle t)
|
void |
sendFunctionLabels(RosterEntry re)
|
protected void |
sendSpeedStepMode(DccThrottle t)
|
protected void |
setAddress(int number,
boolean isLong)
|
protected void |
setDirection(boolean isForward)
|
void |
setFunctionThrottle(DccThrottle t)
|
void |
setLocoForConsistFunctions(String inPackage)
|
void |
setRosterLocoForConsistFunctions(String id)
|
protected void |
setSpeed(int rawSpeed)
handle the conversion from rawSpeed to the float value needed in the DccThrottle |
void |
setWhichThrottle(char c)
|
void |
shutdownThrottle()
|
boolean |
sort(String inPackage)
Figure out what the received command means, where it has to go, and translate to a jmri method. |
void |
syncThrottleFunctions(DccThrottle t,
RosterEntry re)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ArrayList<ThrottleControllerListener> listeners
protected ArrayList<ControllerInterface> controllerListeners
| Constructor Detail |
|---|
public ThrottleController()
public ThrottleController(char whichThrottleChar,
ThrottleControllerListener tcl,
ControllerInterface cl)
| Method Detail |
|---|
public void setWhichThrottle(char c)
public void addThrottleControllerListener(ThrottleControllerListener l)
public void removeThrottleControllerListener(ThrottleControllerListener l)
public void addControllerListener(ControllerInterface listener)
listener - public void removeControllerListener(ControllerInterface listener)
public void addressRelease()
public void addressDispatch()
public void notifyThrottleFound(DccThrottle t)
notifyThrottleFound in interface ThrottleListenert - The throttle which has been found
public void notifyFailedThrottleRequest(DccLocoAddress address,
String reason)
ThrottleListener
notifyFailedThrottleRequest in interface ThrottleListeneraddress - DccLocoAddress of the failed loco request.reason - The reason why the throttle request failed.public void propertyChange(PropertyChangeEvent event)
propertyChange in interface PropertyChangeListenerpublic RosterEntry findRosterEntry(DccThrottle t)
public void syncThrottleFunctions(DccThrottle t,
RosterEntry re)
public void sendFunctionLabels(RosterEntry re)
public void sendAllFunctionStates(DccThrottle t)
protected String buildFStatesHeader()
protected void sendCurrentSpeed(DccThrottle t)
protected void sendCurrentDirection(DccThrottle t)
protected void sendSpeedStepMode(DccThrottle t)
protected void sendAllMomentaryStates(DccThrottle t)
public boolean sort(String inPackage)
inPackage - The package minus its prefix which steered it here.
public void setFunctionThrottle(DccThrottle t)
public void setLocoForConsistFunctions(String inPackage)
public void setRosterLocoForConsistFunctions(String id)
public void shutdownThrottle()
protected void setSpeed(int rawSpeed)
rawSpeed - Value sent from mobile device, range 0 - 126protected void setDirection(boolean isForward)
protected void eStop()
protected void idle()
protected void setAddress(int number,
boolean isLong)
public void requestEntryFromID(String id)
public DccThrottle getThrottle()
public DccThrottle getFunctionThrottle()
public DccLocoAddress getCurrentAddress()
public String getCurrentAddressString()
public void sendAddress()
protected void handleFunction(String inPackage)
protected void forceFunction(String inPackage)
protected void handleSpeedStepMode(int newMode)
protected void handleMomentary(String inPackage)
protected void handleRequest(String inPackage)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||