Package jmri.jmrix.tmcc
Class SerialThrottle
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrix.AbstractThrottle
jmri.jmrix.tmcc.SerialThrottle
- All Implemented Interfaces:
PropertyChangeFirer,PropertyChangeProvider,DccThrottle,Throttle
An implementation of DccThrottle.
Addresses of 99 and below are considered short addresses, and over 100 are considered long addresses.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int(package private) int(package private) int(package private) static final intThis code block is necessary to support the send repeats of the repeatFunctionSendWhileOn(value, func); code above.Fields inherited from class jmri.jmrix.AbstractThrottle
active, adapterMemo, FUNCTION_GROUPS, isForward, speedSetting, speedStepMode, startFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupportFields inherited from interface jmri.Throttle
CONNECTED, DISPATCH_ENABLED, F0, F0Momentary, F1, F10, F10Momentary, F11, F11Momentary, F12, F12Momentary, F13, F13Momentary, F14, F14Momentary, F15, F15Momentary, F16, F16Momentary, F17, F17Momentary, F18, F18Momentary, F19, F19Momentary, F1Momentary, F2, F20, F20Momentary, F21, F21Momentary, F22, F22Momentary, F23, F23Momentary, F24, F24Momentary, F25, F25Momentary, F26, F26Momentary, F27, F27Momentary, F28, F28Momentary, F2Momentary, F3, F3Momentary, F4, F4Momentary, F5, F5Momentary, F6, F6Momentary, F7, F7Momentary, F8, F8Momentary, F9, F9Momentary, ISFORWARD, RELEASE_ENABLED, SPEEDINCREMENT, SPEEDSETTING, SPEEDSTEPMODE, SPEEDSTEPS -
Constructor Summary
ConstructorsConstructorDescriptionSerialThrottle(TmccSystemConnectionMemo memo, DccLocoAddress address) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionLocomotive address.protected voidrepeatFunctionSendWhileOn(int value, int func) protected voidsendFnToLayout(int value, int func) Send these messages to the layout and repeat while button is pressed/on.voidsetFunction(int func, boolean value) Set Loco Function and send to Layout.voidsetIsForward(boolean forward) Implementing functions should override this function, but should either make a call to super.setIsForward() to notify the listeners, or should notify the listeners themselves.voidsetSpeedSetting(float speed) Set the speed.voidSet the speed step value.voidDispose when finished with this Throttle.Methods inherited from class jmri.jmrix.AbstractThrottle
addPropertyChangeListener, dispatch, dispose, finishRecord, getFunction, getFunctionMomentary, getFunctionMomentaryNoWarn, getFunctionNoWarn, getFunctions, getFunctionsMomentary, getIsForward, getMemo, getRosterEntry, getSpeedIncrement, getSpeedSetting, getSpeedStepMode, intSpeed, intSpeed, notifyThrottleDisconnect, notifyThrottleDispatchEnabled, notifyThrottleReleaseEnabled, record, release, removePropertyChangeListener, sendFunctionGroup, sendFunctionGroup1, sendFunctionGroup10, sendFunctionGroup2, sendFunctionGroup3, sendFunctionGroup4, sendFunctionGroup5, sendFunctionGroup6, sendFunctionGroup7, sendFunctionGroup8, sendFunctionGroup9, sendMomentaryFunctionGroup1, sendMomentaryFunctionGroup10, sendMomentaryFunctionGroup2, sendMomentaryFunctionGroup3, sendMomentaryFunctionGroup4, sendMomentaryFunctionGroup5, sendMomentaryFunctionGroup6, sendMomentaryFunctionGroup7, sendMomentaryFunctionGroup8, sendMomentaryFunctionGroup9, setFunctionMomentary, setRosterEntry, setSpeedSetting, setSpeedSettingAgain, startClock, updateFunction, updateFunctionMomentaryMethods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListenerMethods inherited from interface jmri.Throttle
getF0, getF0Momentary, getF1, getF10, getF10Momentary, getF11, getF11Momentary, getF12, getF12Momentary, getF13, getF13Momentary, getF14, getF14Momentary, getF15, getF15Momentary, getF16, getF16Momentary, getF17, getF17Momentary, getF18, getF18Momentary, getF19, getF19Momentary, getF1Momentary, getF2, getF20, getF20Momentary, getF21, getF21Momentary, getF22, getF22Momentary, getF23, getF23Momentary, getF24, getF24Momentary, getF25, getF25Momentary, getF26, getF26Momentary, getF27, getF27Momentary, getF28, getF28Momentary, getF2Momentary, getF3, getF3Momentary, getF4, getF4Momentary, getF5, getF5Momentary, getF6, getF6Momentary, getF7, getF7Momentary, getF8, getF8Momentary, getF9, getF9Momentary, setF0, setF0Momentary, setF1, setF10, setF10Momentary, setF11, setF11Momentary, setF12, setF12Momentary, setF13, setF13Momentary, setF14, setF14Momentary, setF15, setF15Momentary, setF16, setF16Momentary, setF17, setF17Momentary, setF18, setF18Momentary, setF19, setF19Momentary, setF1Momentary, setF2, setF20, setF20Momentary, setF21, setF21Momentary, setF22, setF22Momentary, setF23, setF23Momentary, setF24, setF24Momentary, setF25, setF25Momentary, setF26, setF26Momentary, setF27, setF27Momentary, setF28, setF28Momentary, setF2Momentary, setF3, setF3Momentary, setF4, setF4Momentary, setF5, setF5Momentary, setF6, setF6Momentary, setF7, setF7Momentary, setF8, setF8Momentary, setF9, setF9Momentary
-
Field Details
-
checksumAccumulator
-
previousValue
int previousValue -
newValue
int newValue -
REPEAT_TIME
This code block is necessary to support the send repeats of the repeatFunctionSendWhileOn(value, func); code above. This code block "Sends Again" if FkKey is still pressed/on, and repeats per the interval set in static final int REPEAT_TIME.- See Also:
-
-
Constructor Details
-
SerialThrottle
Constructor.- Parameters:
memo- the connected SerialTrafficControlleraddress- Loco ID
-
-
Method Details
-
getLocoAddress
Locomotive address. The exact format is defined by the specific implementation, as subclasses of LocoAddress will contain different information.This is an unbound property.
- Returns:
- The locomotive address
-
setFunction
Set Loco Function and send to Layout.- Specified by:
setFunctionin interfaceThrottle- Overrides:
setFunctionin classAbstractThrottle- Parameters:
func- Function Number, 0-28value- New Function State. True on, false off.
-
setSpeedSetting
Set the speed.- Specified by:
setSpeedSettingin interfaceThrottle- Overrides:
setSpeedSettingin classAbstractThrottle- Parameters:
speed- Number from 0 to 1; less than zero is emergency stop
-
setIsForward
Implementing functions should override this function, but should either make a call to super.setIsForward() to notify the listeners, or should notify the listeners themselves.- Specified by:
setIsForwardin interfaceThrottle- Overrides:
setIsForwardin classAbstractThrottle- Parameters:
forward- true if forward; false otherwise
-
sendFnToLayout
Send these messages to the layout and repeat while button is pressed/on.- Parameters:
value- Content of message to be sent in three bytesfunc- The number of the function being addressed
-
repeatFunctionSendWhileOn
-
setSpeedStepMode
Description copied from class:AbstractThrottleSet the speed step value. Default should be 128 speed step mode in most cases.Specific implementations should override this function.
- Specified by:
setSpeedStepModein interfaceDccThrottle- Overrides:
setSpeedStepModein classAbstractThrottle- Parameters:
mode- the current speed step mode
-
throttleDispose
Dispose when finished with this Throttle. May be used in tests for cleanup. Throttles normally callAbstractThrottle.finishRecord()here.- Specified by:
throttleDisposein classAbstractThrottle
-