Package jmri.jmrit.withrottle
Class MultiThrottleController
- java.lang.Object
- 
- jmri.jmrit.withrottle.ThrottleController
- 
- jmri.jmrit.withrottle.MultiThrottleController
 
 
- 
- All Implemented Interfaces:
- java.beans.PropertyChangeListener,- java.util.EventListener,- ThrottleListener
 
 public class MultiThrottleController extends ThrottleController 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface jmri.ThrottleListenerThrottleListener.DecisionType
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected booleanisStealAddress- 
Fields inherited from class jmri.jmrit.withrottle.ThrottleControllercontrollerListeners, functionThrottle, isAddressSet, isMomF2, lastSentSpeed, leadAddress, leadLocoF, listeners, locoKey, newSpeed, rosterLoco, speedMultiplier, throttle, useLeadLocoF, whichThrottle
 
- 
 - 
Constructor SummaryConstructors Constructor Description MultiThrottleController(char id, java.lang.String key, ThrottleControllerListener tcl, ControllerInterface ci)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringbuildPacketWithChar(char chr)Builds a header to send to the wi-fi device for use in a message.voidnotifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)A decision is required for Throttle creation to continue.voidpropertyChange(java.beans.PropertyChangeEvent event)voidsendAddress()A + indicates the address was acquired, - indicates releasedvoidsendAllFunctionStates(DccThrottle t)This replaces the previous method of sending a string of function states, and now sends them individually, the same as a property change would.protected voidsendAllMomentaryStates(DccThrottle t)protected voidsendCurrentDirection(DccThrottle t)protected voidsendCurrentSpeed(DccThrottle t)voidsendFunctionLabels(RosterEntry re)This replaces the previous method of sending a string of function labels.protected voidsendSpeedStepMode(DccThrottle t)voidsendStealAddress()Send a message to a device that steal is needed.protected voidsetAddress(int number, boolean isLong)Add option to not silently share ("steal") the requested address- 
Methods inherited from class jmri.jmrit.withrottle.ThrottleControlleraddControllerListener, addressDispatch, addressRelease, addThrottleControllerListener, buildFStatesHeader, eStop, findRosterEntry, forceFunction, getCurrentAddress, getCurrentAddressString, getCurrentRosterIdString, getFunctionThrottle, getThrottle, handleFunction, handleMomentary, handleRequest, handleSpeedStepMode, idle, notifyFailedThrottleRequest, notifyThrottleFound, removeControllerListener, removeThrottleControllerListener, requestEntryFromID, setDirection, setFunctionThrottle, setLocoForConsistFunctions, setRosterLocoForConsistFunctions, setSpeed, setWhichThrottle, shutdownThrottle, sort, syncThrottleFunctions
 
- 
 
- 
- 
- 
Field Detail- 
isStealAddressprotected boolean isStealAddress 
 
- 
 - 
Constructor Detail- 
MultiThrottleControllerpublic MultiThrottleController(char id, java.lang.String key, ThrottleControllerListener tcl, ControllerInterface ci) 
 
- 
 - 
Method Detail- 
buildPacketWithCharpublic java.lang.String buildPacketWithChar(char chr) Builds a header to send to the wi-fi device for use in a message. Includes a separator - <;>- Parameters:
- chr- the character indicating what action is performed
- Returns:
- a pre-assembled header for this DccThrottle
 
 - 
propertyChangepublic void propertyChange(java.beans.PropertyChangeEvent event) - Specified by:
- propertyChangein interface- java.beans.PropertyChangeListener
- Overrides:
- propertyChangein class- ThrottleController
 
 - 
sendFunctionLabelspublic void sendFunctionLabels(RosterEntry re) This replaces the previous method of sending a string of function labels. Checks for labels across all possible functions of this roster entry. Example:MTLL1234<;>]\[Light]\[Bell]\[Horn]\[]\[]\[]\[]\[]\[Mute]\[]\[]\[]\[etc.- Overrides:
- sendFunctionLabelsin class- ThrottleController
- Parameters:
- re- The roster entry to get the labels from.
 
 - 
sendAllFunctionStatespublic void sendAllFunctionStates(DccThrottle t) This replaces the previous method of sending a string of function states, and now sends them individually, the same as a property change would.- Overrides:
- sendAllFunctionStatesin class- ThrottleController
- Parameters:
- t- the throttle to send the states of.
 
 - 
sendCurrentSpeedprotected void sendCurrentSpeed(DccThrottle t) - Overrides:
- sendCurrentSpeedin class- ThrottleController
 
 - 
sendCurrentDirectionprotected void sendCurrentDirection(DccThrottle t) - Overrides:
- sendCurrentDirectionin class- ThrottleController
 
 - 
sendSpeedStepModeprotected void sendSpeedStepMode(DccThrottle t) - Overrides:
- sendSpeedStepModein class- ThrottleController
 
 - 
sendAllMomentaryStatesprotected void sendAllMomentaryStates(DccThrottle t) - Overrides:
- sendAllMomentaryStatesin class- ThrottleController
 
 - 
sendAddresspublic void sendAddress() A + indicates the address was acquired, - indicates released- Overrides:
- sendAddressin class- ThrottleController
 
 - 
sendStealAddresspublic void sendStealAddress() Send a message to a device that steal is needed. This message can be sent back to JMRI verbatim to complete a steal.
 - 
notifyDecisionRequiredpublic void notifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question) A decision is required for Throttle creation to continue.Steal / Cancel, Share / Cancel, or Steal / Share Cancel Callback of a request for an address that is in use. Will initiate a steal only if this MTC is flagged to do so. Otherwise, it will remove the request for the address. calls notifyFailedThrottleRequest, Steal Required Get 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 interface- ThrottleListener
- Overrides:
- notifyDecisionRequiredin class- ThrottleController
- Parameters:
- address- The LocoAddress that needs the decision.
- question- The question being asked, steal / cancel, share / cancel, steal / share / cancel
 
 - 
setAddressprotected void setAddress(int number, boolean isLong) Add option to not silently share ("steal") the requested address- Overrides:
- setAddressin class- ThrottleController
 
 
- 
 
-