Package jmri.jmrit.withrottle
Class MultiThrottleController
java.lang.Object
jmri.jmrit.withrottle.ThrottleController
jmri.jmrit.withrottle.MultiThrottleController
- All Implemented Interfaces:
PropertyChangeListener,EventListener,ThrottleListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.ThrottleListener
ThrottleListener.DecisionType -
Field Summary
FieldsFields inherited from class jmri.jmrit.withrottle.ThrottleController
controllerListeners, functionThrottle, isAddressSet, isMomF2, lastSentSpeed, leadAddress, leadLocoF, listeners, locoKey, newSpeed, rosterLoco, speedMultiplier, throttle, useLeadLocoF, whichThrottle -
Constructor Summary
ConstructorsConstructorDescriptionMultiThrottleController(char id, String key, ThrottleControllerListener tcl, ControllerInterface ci) -
Method Summary
Modifier and TypeMethodDescriptionbuildPacketWithChar(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.voidvoidA + indicates the address was acquired, - indicates releasedvoidThis replaces the previous method of sending a string of function states, and now sends them individually, the same as a property change would.protected voidprotected voidprotected voidvoidThis replaces the previous method of sending a string of function labels.protected voidvoidSend a message to a device that steal is needed.protected voidsetAddress(int number, boolean isLong) Add option to not silently share ("steal") the requested addressMethods inherited from class jmri.jmrit.withrottle.ThrottleController
addControllerListener, 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 Details
-
isStealAddress
-
-
Constructor Details
-
MultiThrottleController
public MultiThrottleController(char id, String key, ThrottleControllerListener tcl, ControllerInterface ci)
-
-
Method Details
-
buildPacketWithChar
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
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classThrottleController
-
sendFunctionLabels
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 classThrottleController- Parameters:
re- The roster entry to get the labels from.
-
sendAllFunctionStates
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 classThrottleController- Parameters:
t- the throttle to send the states of.
-
sendCurrentSpeed
- Overrides:
sendCurrentSpeedin classThrottleController
-
sendCurrentDirection
- Overrides:
sendCurrentDirectionin classThrottleController
-
sendSpeedStepMode
- Overrides:
sendSpeedStepModein classThrottleController
-
sendAllMomentaryStates
- Overrides:
sendAllMomentaryStatesin classThrottleController
-
sendAddress
A + indicates the address was acquired, - indicates released- Overrides:
sendAddressin classThrottleController
-
sendStealAddress
Send a message to a device that steal is needed. This message can be sent back to JMRI verbatim to complete a steal. -
notifyDecisionRequired
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 interfaceThrottleListener- Overrides:
notifyDecisionRequiredin classThrottleController- Parameters:
address- The LocoAddress that needs the decision.question- The question being asked, steal / cancel, share / cancel, steal / share / cancel
-
setAddress
Add option to not silently share ("steal") the requested address- Overrides:
setAddressin classThrottleController
-