jmri.jmrit.withrottle
Class MultiThrottle

Show UML class diagram
java.lang.Object
  extended by jmri.jmrit.withrottle.MultiThrottle

public class MultiThrottle
extends Object

Keeps track of what locos are being controlled by a throttle, and passes the control messages on to them. Creates a new MultiThrottleController for each loco requested on this throttle. Each loco will then be able to be controlled individually. '*' is a wildcard loco key. Forwards to all locos on this MultiThrottle.

Sample messages:


Field Summary
(package private)  Hashtable<String,MultiThrottleController> throttles
           
(package private)  char whichThrottle
           
 
Constructor Summary
MultiThrottle(char id, ThrottleControllerListener tcl, ControllerInterface ci)
           
 
Method Summary
 boolean addThrottleController(String key, String action)
           
 void dispose()
           
 void eStop()
           
 void handleMessage(String message)
          Handle a message sent from the device.
 void passActionsToControllers(String key, String action)
           
 boolean removeThrottleController(String key, String action)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

whichThrottle

char whichThrottle

throttles

Hashtable<String,MultiThrottleController> throttles
Constructor Detail

MultiThrottle

public MultiThrottle(char id,
                     ThrottleControllerListener tcl,
                     ControllerInterface ci)
Method Detail

handleMessage

public void handleMessage(String message)
Handle a message sent from the device. A key is used to send an action to the correct loco. '*' is a wildcard key, sends action to all locos in this MultiThrottle.

Parameters:
message - Consists of a control character, the loco's key, a separator "<;>", and the action to forward to the MultiThrottleController.

addThrottleController

public boolean addThrottleController(String key,
                                     String action)

removeThrottleController

public boolean removeThrottleController(String key,
                                        String action)

passActionsToControllers

public void passActionsToControllers(String key,
                                     String action)

dispose

public void dispose()

eStop

public void eStop()


Copyright © 1997-2013 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads