001package jmri;
002
003import javax.annotation.Nonnull;
004
005import jmri.beans.PropertyChangeProvider;
006
007/**
008 * A Throttle object can be manipulated to change the speed, direction and
009 * functions of a single locomotive.
010 * <p>
011 * A Throttle implementation provides the actual control mechanism. These are
012 * obtained via a {@link ThrottleManager}.
013 * <p>
014 * With some control systems, there are only a limited number of Throttle's
015 * available.
016 * <p>
017 * On DCC systems, Throttles are often actually {@link DccThrottle} objects,
018 * which have some additional DCC-specific capabilities.
019 * <p>
020 * {@link java.beans.PropertyChangeEvent}s that can be listened to include
021 * <ul>
022 * <li>SpeedSetting, SpeedSteps, isForward
023 * <li>F0, F1, F2 .. F27, F28, F29, F30 ..
024 * <li>F0Momentary, F1Momentary, F2Momentary .. F28Momentary .. F29Momentary ..
025 * <li>ThrottleAssigned, throttleRemoved, throttleConnected,
026 * throttleNotFoundInRemoval
027 * <li>DispatchEnabled, ReleaseEnabled
028 * </ul>
029 *
030 * @author Bob Jacobsen Copyright (C) 2001, 2008
031 */
032public interface Throttle extends PropertyChangeProvider {
033
034    /**
035     * Constant used in getThrottleInfo.
036     */
037    String SPEEDSTEPMODE = "SpeedStepsMode"; // speed steps NOI18N
038
039    /*
040     * Properties strings sent to property change listeners
041     */
042
043    /**
044     * Constant sent by Throttle on Speed Steps Property Change.
045     */
046    String SPEEDSTEPS = "SpeedSteps";
047
048    /**
049     * Constant sent by Throttle on Speed Setting Property Change.
050     */
051    String SPEEDSETTING = "SpeedSetting";
052
053    /**
054     * Constant sent by Throttle on Direction Property Change.
055     */
056    String ISFORWARD = "IsForward";
057
058    /**
059     * Constant sent by Throttle on Speed Increment Property Change.
060     */
061    String SPEEDINCREMENT = "SpeedIncrement";
062
063    /**
064     * Constant sent by Throttle on Connected Property Change.
065     */
066    String CONNECTED = "ThrottleConnected";
067
068    /**
069     * Constant sent by Throttle on Dispatch Enabled Property Change.
070     */
071    String DISPATCH_ENABLED = "DispatchEnabled";
072
073    /**
074     * Constant sent by Throttle on Release Enabled Property Change.
075     */
076    String RELEASE_ENABLED = "ReleaseEnabled";
077
078    /**
079     * Constants to represent the functions F0 through F28.
080     * @deprecated Use {@code getFunctionString(int momentFunctionNum) } instead.
081     */
082    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
083    static final String F0 = "F0"; // NOI18N
084    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
085    static final String F1 = "F1"; // NOI18N
086    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
087    static final String F2 = "F2"; // NOI18N
088    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
089    static final String F3 = "F3"; // NOI18N
090    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
091    static final String F4 = "F4"; // NOI18N
092    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
093    static final String F5 = "F5"; // NOI18N
094    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
095    static final String F6 = "F6"; // NOI18N
096    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
097    static final String F7 = "F7"; // NOI18N
098    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
099    static final String F8 = "F8"; // NOI18N
100    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
101    static final String F9 = "F9"; // NOI18N
102    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
103    static final String F10 = "F10"; // NOI18N
104    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
105    static final String F11 = "F11"; // NOI18N
106    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
107    static final String F12 = "F12"; // NOI18N
108    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
109    static final String F13 = "F13"; // NOI18N
110    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
111    static final String F14 = "F14"; // NOI18N
112    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
113    static final String F15 = "F15"; // NOI18N
114    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
115    static final String F16 = "F16"; // NOI18N
116    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
117    static final String F17 = "F17"; // NOI18N
118    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
119    static final String F18 = "F18"; // NOI18N
120    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
121    static final String F19 = "F19"; // NOI18N
122    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
123    static final String F20 = "F20"; // NOI18N
124    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
125    static final String F21 = "F21"; // NOI18N
126    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
127    static final String F22 = "F22"; // NOI18N
128    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
129    static final String F23 = "F23"; // NOI18N
130    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
131    static final String F24 = "F24"; // NOI18N
132    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
133    static final String F25 = "F25"; // NOI18N
134    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
135    static final String F26 = "F26"; // NOI18N
136    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
137    static final String F27 = "F27"; // NOI18N
138    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
139    static final String F28 = "F28"; // NOI18N
140
141    /**
142     * Constants to represent the functions F0 through F28.
143     * @deprecated Use {@code getFunctionMomentaryString(int momentFunctionNum) } instead.
144     */
145    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
146    static final String F0Momentary = "F0Momentary"; // NOI18N
147    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
148    static final String F1Momentary = "F1Momentary"; // NOI18N
149    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
150    static final String F2Momentary = "F2Momentary"; // NOI18N
151    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
152    static final String F3Momentary = "F3Momentary"; // NOI18N
153    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
154    static final String F4Momentary = "F4Momentary"; // NOI18N
155    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
156    static final String F5Momentary = "F5Momentary"; // NOI18N
157    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
158    static final String F6Momentary = "F6Momentary"; // NOI18N
159    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
160    static final String F7Momentary = "F7Momentary"; // NOI18N
161    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
162    static final String F8Momentary = "F8Momentary"; // NOI18N
163    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
164    static final String F9Momentary = "F9Momentary"; // NOI18N
165    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
166    static final String F10Momentary = "F10Momentary"; // NOI18N
167    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
168    static final String F11Momentary = "F11Momentary"; // NOI18N
169    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
170    static final String F12Momentary = "F12Momentary"; // NOI18N
171    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
172    static final String F13Momentary = "F13Momentary"; // NOI18N
173    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
174    static final String F14Momentary = "F14Momentary"; // NOI18N
175    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
176    static final String F15Momentary = "F15Momentary"; // NOI18N
177    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
178    static final String F16Momentary = "F16Momentary"; // NOI18N
179    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
180    static final String F17Momentary = "F17Momentary"; // NOI18N
181    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
182    static final String F18Momentary = "F18Momentary"; // NOI18N
183    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
184    static final String F19Momentary = "F19Momentary"; // NOI18N
185    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
186    static final String F20Momentary = "F20Momentary"; // NOI18N
187    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
188    static final String F21Momentary = "F21Momentary"; // NOI18N
189    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
190    static final String F22Momentary = "F22Momentary"; // NOI18N
191    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
192    static final String F23Momentary = "F23Momentary"; // NOI18N
193    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
194    static final String F24Momentary = "F24Momentary"; // NOI18N
195    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
196    static final String F25Momentary = "F25Momentary"; // NOI18N
197    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
198    static final String F26Momentary = "F26Momentary"; // NOI18N
199    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
200    static final String F27Momentary = "F27Momentary"; // NOI18N
201    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
202    static final String F28Momentary = "F28Momentary"; // NOI18N
203
204    /**
205     * Get the Function String for a particular Function number.
206     * Commonly used string in Throttle property change listeners.
207     * @param functionNum Function Number, minimum 0.
208     * @return function string, e.g. "F0" or "F7".
209     */
210    static String getFunctionString(int functionNum){
211        StringBuilder sb = new StringBuilder(3);
212        sb.append("F"); // NOI18N
213        sb.append(functionNum);
214        return sb.toString();
215    }
216
217    /**
218     * Get the Momentary Function String for a particular Function number.
219     * Commonly used string in Throttle property change listeners.
220     * @param momentFunctionNum Momentary Function Number, minimum 0.
221     * @return momentary function string, e.g. "F0Momentary" or "F7Momentary".
222     */
223    static String getFunctionMomentaryString(int momentFunctionNum){
224        StringBuilder sb = new StringBuilder(12);
225        sb.append("F"); // NOI18N
226        sb.append(momentFunctionNum);
227        sb.append("Momentary"); // NOI18N
228        return sb.toString();
229    }
230
231    /**
232     * Get copy of function array.
233     * Typically returns array length of 29, i.e. 0-28.
234     * @return function array, length dependant by hardware type.
235     */
236    @Nonnull
237    abstract boolean[] getFunctions();
238
239    /**
240     * Get copy of function momentary status array.
241     * Typically returns array length of 29, i.e. 0-28.
242     * @return momentary function array, length dependant by hardware type.
243     */
244    @Nonnull
245    abstract boolean[] getFunctionsMomentary();
246
247    /**
248     * Get the current speed setting, expressed as a value {@literal 0.0 -> 1.0.}
249     * This property is bound to the {@link #SPEEDSETTING} name.
250     *
251     * @return the speed as a {@literal 0.0 -> 1.0.}  fraction of maximum possible speed or -1 for emergency stop.
252     */
253    float getSpeedSetting();
254
255    /**
256     * Set the desired speed setting, expressed as a value {@literal 0.0 -> 1.0.} Negative means
257     * emergency stop.
258     * This property is bound to the {@link #SPEEDSETTING} name.
259     *
260     * @param speed the speed as a {@literal 0.0 -> 1.0.} fraction of maximum possible speed or -1 for emergency stop.
261     */
262    void setSpeedSetting(float speed);
263
264    /**
265     * Set the desired speed, expressed as a value {@literal 0.0 -> 1.0.},
266     * with extra control over the messages to the layout. Negative means
267     * emergency stop.
268     * On systems which normally suppress the sending of a
269     * message if the new speed won't (appear to JMRI to) make any difference,
270     * the two extra options allow the calling method to insist the message is
271     * sent under some circumstances.
272     *
273     * @param speed the speed as a {@literal 0.0 -> 1.0.} fraction of maximum possible speed or -1 for emergency stop.
274     * @param allowDuplicates       if true, don't suppress messages that should
275     *                              have no effect
276     * @param allowDuplicatesOnStop if true, and the new speed is idle or estop,
277     *                              don't suppress messages
278     */
279    void setSpeedSetting(float speed, boolean allowDuplicates, boolean allowDuplicatesOnStop);
280
281    /**
282     * Set the speed, and on systems which normally suppress the sending of a
283     * message make sure the message gets sent.
284     *
285     * @param speed the speed as a {@literal 0.0 -> 1.0.} fraction of maximum possible speed or -1 for emergency stop.
286     */
287    void setSpeedSettingAgain(float speed);
288
289    /**
290     * direction This is an bound property.
291     *
292     * @return true if forward, false if reverse or undefined
293     */
294    boolean getIsForward();
295
296    /**
297     * Set direction.
298     *
299     * @param forward true if forward, false if reverse or undefined
300     */
301    void setIsForward(boolean forward);
302
303    // functions - note that we use the naming for DCC, though that's not the implication;
304    // see also DccThrottle interface
305
306    /**
307     * Set Loco Function and send to Layout.
308     * @param functionNum Function Number, 0-28
309     * @param newState New Function State. True on, false off.
310     */
311    abstract void setFunction(int functionNum, boolean newState);
312
313    /**
314     * Get Loco Function status.
315     * @param functionNum Function Number, 0-28
316     * @return Function State. True on, false off.
317     */
318    boolean getFunction(int functionNum);
319
320    /**
321     * Set Momentary Loco Function and send to Layout.
322     * @param momFuncNum Momentary Function Number, 0-28
323     * @param state New Function State. True on, false off.
324     */
325    abstract void setFunctionMomentary(int momFuncNum, boolean state);
326
327    /**
328     * Get the Momentary Function Value.
329     * @param fN Momentary function number
330     * @return true if momentary function is on, else false.
331     */
332    abstract boolean getFunctionMomentary(int fN);
333
334    /**
335     * Get Function 0 Status.
336     * @return true for Function On, false for Function Off.
337     * @deprecated Use {@code getFunction(int functionNum) } instead.
338     */
339    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
340    default boolean getF0() {
341        return getFunction(0);
342    }
343
344    /**
345     * Get Function 1 Status.
346     * @return true for Function On, false for Function Off.
347     * @deprecated Use {@code getFunction(int functionNum) } instead.
348     */
349    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
350    default boolean getF1() {
351        return getFunction(1);
352    }
353
354    /**
355     * Get Function 2 Status.
356     * @return true for Function On, false for Function Off.
357     * @deprecated Use {@code getFunction(int functionNum) } instead.
358     */
359    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
360    default boolean getF2() {
361        return getFunction(2);
362    }
363
364    /**
365     * Get Function 3 Status.
366     * @return true for Function On, false for Function Off.
367     * @deprecated Use {@code getFunction(int functionNum) } instead.
368     */
369    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
370    default boolean getF3() {
371        return getFunction(3);
372    }
373
374    /**
375     * Get Function 4 Status.
376     * @return true for Function On, false for Function Off.
377     * @deprecated Use {@code getFunction(int functionNum) } instead.
378     */
379    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
380    default boolean getF4() {
381        return getFunction(4);
382    }
383
384    /**
385     * Get Function 5 Status.
386     * @return true for Function On, false for Function Off.
387     * @deprecated Use {@code getFunction(int functionNum) } instead.
388     */
389    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
390    default boolean getF5() {
391        return getFunction(5);
392    }
393
394    /**
395     * Get Function 6 Status.
396     * @return true for Function On, false for Function Off.
397     * @deprecated Use {@code getFunction(int functionNum) } instead.
398     */
399    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
400    default boolean getF6() {
401        return getFunction(6);
402    }
403
404    /**
405     * Get Function 7 Status.
406     * @return true for Function On, false for Function Off.
407     * @deprecated Use {@code getFunction(int functionNum) } instead.
408     */
409    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
410    default boolean getF7() {
411        return getFunction(7);
412    }
413
414    /**
415     * Get Function 8 Status.
416     * @return true for Function On, false for Function Off.
417     * @deprecated Use {@code getFunction(int functionNum) } instead.
418     */
419    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
420    default boolean getF8() {
421        return getFunction(8);
422    }
423
424    /**
425     * Get Function 9 Status.
426     * @return true for Function On, false for Function Off.
427     * @deprecated Use {@code getFunction(int functionNum) } instead.
428     */
429    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
430    default boolean getF9() {
431        return getFunction(9);
432    }
433
434    /**
435     * Get Function 10 Status.
436     * @return true for Function On, false for Function Off.
437     * @deprecated Use {@code getFunction(int functionNum) } instead.
438     */
439    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
440    default boolean getF10() {
441        return getFunction(10);
442    }
443
444    /**
445     * Get Function 11 Status.
446     * @return true for Function On, false for Function Off.
447     * @deprecated Use {@code getFunction(int functionNum) } instead.
448     */
449    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
450    default boolean getF11() {
451        return getFunction(11);
452    }
453
454    /**
455     * Get Function 12 Status.
456     * @return true for Function On, false for Function Off.
457     * @deprecated Use {@code getFunction(int functionNum) } instead.
458     */
459    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
460    default boolean getF12() {
461        return getFunction(12);
462    }
463
464    /**
465     * Get Function 13 Status.
466     * @return true for Function On, false for Function Off.
467     * @deprecated Use {@code getFunction(int functionNum) } instead.
468     */
469    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
470    default boolean getF13() {
471        return getFunction(13);
472    }
473
474    /**
475     * Get Function 14 Status.
476     * @return true for Function On, false for Function Off.
477     * @deprecated Use {@code getFunction(int functionNum) } instead.
478     */
479    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
480    default boolean getF14() {
481        return getFunction(14);
482    }
483
484    /**
485     * Get Function 15 Status.
486     * @return true for Function On, false for Function Off.
487     * @deprecated Use {@code getFunction(int functionNum) } instead.
488     */
489    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
490    default boolean getF15() {
491        return getFunction(15);
492    }
493
494    /**
495     * Get Function 16 Status.
496     * @return true for Function On, false for Function Off.
497     * @deprecated Use {@code getFunction(int functionNum) } instead.
498     */
499    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
500    default boolean getF16() {
501        return getFunction(16);
502    }
503
504    /**
505     * Get Function 17 Status.
506     * @return true for Function On, false for Function Off.
507     * @deprecated Use {@code getFunction(int functionNum) } instead.
508     */
509    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
510    default boolean getF17() {
511        return getFunction(17);
512    }
513
514    /**
515     * Get Function 18 Status.
516     * @return true for Function On, false for Function Off.
517     * @deprecated Use {@code getFunction(int functionNum) } instead.
518     */
519    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
520    default boolean getF18() {
521        return getFunction(18);
522    }
523
524    /**
525     * Get Function 19 Status.
526     * @return true for Function On, false for Function Off.
527     * @deprecated Use {@code getFunction(int functionNum) } instead.
528     */
529    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
530    default boolean getF19() {
531        return getFunction(19);
532    }
533
534    /**
535     * Get Function 20 Status.
536     * @return true for Function On, false for Function Off.
537     * @deprecated Use {@code getFunction(int functionNum) } instead.
538     */
539    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
540    default boolean getF20() {
541        return getFunction(20);
542    }
543
544    /**
545     * Get Function 21 Status.
546     * @return true for Function On, false for Function Off.
547     * @deprecated Use {@code getFunction(int functionNum) } instead.
548     */
549    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
550    default boolean getF21() {
551        return getFunction(21);
552    }
553
554    /**
555     * Get Function 22 Status.
556     * @return true for Function On, false for Function Off.
557     * @deprecated Use {@code getFunction(int functionNum) } instead.
558     */
559    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
560    default boolean getF22() {
561        return getFunction(22);
562    }
563
564    /**
565     * Get Function 23 Status.
566     * @return true for Function On, false for Function Off.
567     * @deprecated Use {@code getFunction(int functionNum) } instead.
568     */
569    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
570    default boolean getF23() {
571        return getFunction(23);
572    }
573
574    /**
575     * Get Function 24 Status.
576     * @return true for Function On, false for Function Off.
577     * @deprecated Use {@code getFunction(int functionNum) } instead.
578     */
579    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
580    default boolean getF24() {
581        return getFunction(24);
582    }
583
584    /**
585     * Get Function 25 Status.
586     * @return true for Function On, false for Function Off.
587     * @deprecated Use {@code getFunction(int functionNum) } instead.
588     */
589    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
590    default boolean getF25() {
591        return getFunction(25);
592    }
593
594    /**
595     * Get Function 26 Status.
596     * @return true for Function On, false for Function Off.
597     * @deprecated Use {@code getFunction(int functionNum) } instead.
598     */
599    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
600    default boolean getF26() {
601        return getFunction(26);
602    }
603
604    /**
605     * Get Function 27 Status.
606     * @return true for Function On, false for Function Off.
607     * @deprecated Use {@code getFunction(int functionNum) } instead.
608     */
609    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
610    default boolean getF27() {
611        return getFunction(27);
612    }
613
614    /**
615     * Get Function 28 Status.
616     * @return true for Function On, false for Function Off.
617     * @deprecated Use {@code getFunction(int functionNum) } instead.
618     */
619    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
620    default boolean getF28() {
621        return getFunction(28);
622    }
623
624    /**
625     * Set Function 0 Status.
626     * @param f0 true for Function On, false for Function Off.
627     * @deprecated Use {@code setFunction(int functionNum) } instead.
628     */
629    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
630    default void setF0(boolean f0) {
631        setFunction(0,f0);
632    }
633
634    /**
635     * Set Function 1 Status.
636     * @param f1 true for Function On, false for Function Off.
637     * @deprecated Use {@code setFunction(int functionNum) } instead.
638     */
639    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
640    default void setF1(boolean f1) {
641        setFunction(1,f1);
642    }
643
644    /**
645     * Set Function 2 Status.
646     * @param f2 true for Function On, false for Function Off.
647     * @deprecated Use {@code setFunction(int functionNum) } instead.
648     */
649    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
650    default void setF2(boolean f2) {
651        setFunction(2,f2);
652    }
653
654    /**
655     * Set Function 3 Status.
656     * @param f3 true for Function On, false for Function Off.
657     * @deprecated Use {@code setFunction(int functionNum) } instead.
658     */
659    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
660    default void setF3(boolean f3) {
661        setFunction(3,f3);
662    }
663
664    /**
665     * Set Function 4 Status.
666     * @param f4 true for Function On, false for Function Off.
667     * @deprecated Use {@code setFunction(int functionNum) } instead.
668     */
669    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
670    default void setF4(boolean f4) {
671        setFunction(4,f4);
672    }
673
674    /**
675     * Set Function 5 Status.
676     * @param f5 true for Function On, false for Function Off.
677     * @deprecated Use {@code setFunction(int functionNum) } instead.
678     */
679    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
680    default void setF5(boolean f5) {
681        setFunction(5,f5);
682    }
683
684    /**
685     * Set Function 6 Status.
686     * @param f6 true for Function On, false for Function Off.
687     * @deprecated Use {@code setFunction(int functionNum) } instead.
688     */
689    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
690    default void setF6(boolean f6) {
691        setFunction(6,f6);
692    }
693
694    /**
695     * Set Function 7 Status.
696     * @param f7 true for Function On, false for Function Off.
697     * @deprecated Use {@code setFunction(int functionNum) } instead.
698     */
699    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
700    default void setF7(boolean f7) {
701        setFunction(7,f7);
702    }
703
704    /**
705     * Set Function 8 Status.
706     * @param f8 true for Function On, false for Function Off.
707     * @deprecated Use {@code setFunction(int functionNum) } instead.
708     */
709    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
710    default void setF8(boolean f8) {
711        setFunction(8,f8);
712    }
713
714    /**
715     * Set Function 9 Status.
716     * @param f9 true for Function On, false for Function Off.
717     * @deprecated Use {@code setFunction(int functionNum) } instead.
718     */
719    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
720    default void setF9(boolean f9) {
721        setFunction(9,f9);
722    }
723
724    /**
725     * Set Function 10 Status.
726     * @param f10 true for Function On, false for Function Off.
727     * @deprecated Use {@code setFunction(int functionNum) } instead.
728     */
729    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
730    default void setF10(boolean f10) {
731        setFunction(10,f10);
732    }
733
734    /**
735     * Set Function 11 Status.
736     * @param f11 true for Function On, false for Function Off.
737     * @deprecated Use {@code setFunction(int functionNum) } instead.
738     */
739    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
740    default void setF11(boolean f11) {
741        setFunction(11,f11);
742    }
743
744    /**
745     * Set Function 12 Status.
746     * @param f12 true for Function On, false for Function Off.
747     * @deprecated Use {@code setFunction(int functionNum) } instead.
748     */
749    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
750    default void setF12(boolean f12) {
751        setFunction(12,f12);
752    }
753
754    /**
755     * Set Function 13 Status.
756     * @param f13 true for Function On, false for Function Off.
757     * @deprecated Use {@code setFunction(int functionNum) } instead.
758     */
759    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
760    default void setF13(boolean f13) {
761        setFunction(13,f13);
762    }
763
764    /**
765     * Set Function 14 Status.
766     * @param f14 true for Function On, false for Function Off.
767     * @deprecated Use {@code setFunction(int functionNum) } instead.
768     */
769    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
770    default void setF14(boolean f14) {
771        setFunction(14,f14);
772    }
773
774    /**
775     * Set Function 15 Status.
776     * @param f15 true for Function On, false for Function Off.
777     * @deprecated Use {@code setFunction(int functionNum) } instead.
778     */
779    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
780    default void setF15(boolean f15) {
781        setFunction(15,f15);
782    }
783
784    /**
785     * Set Function 16 Status.
786     * @param f16 true for Function On, false for Function Off.
787     * @deprecated Use {@code setFunction(int functionNum) } instead.
788     */
789    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
790    default void setF16(boolean f16) {
791        setFunction(16,f16);
792    }
793
794    /**
795     * Set Function 17 Status.
796     * @param f17 true for Function On, false for Function Off.
797     * @deprecated Use {@code setFunction(int functionNum) } instead.
798     */
799    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
800    default void setF17(boolean f17) {
801        setFunction(17,f17);
802    }
803
804    /**
805     * Set Function 18 Status.
806     * @param f18 true for Function On, false for Function Off.
807     * @deprecated Use {@code setFunction(int functionNum) } instead.
808     */
809    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
810    default void setF18(boolean f18) {
811        setFunction(18,f18);
812    }
813
814    /**
815     * Set Function 19 Status.
816     * @param f19 true for Function On, false for Function Off.
817     * @deprecated Use {@code setFunction(int functionNum) } instead.
818     */
819    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
820    default void setF19(boolean f19) {
821        setFunction(19,f19);
822    }
823
824    /**
825     * Set Function 20 Status.
826     * @param f20 true for Function On, false for Function Off.
827     * @deprecated Use {@code setFunction(int functionNum) } instead.
828     */
829    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
830    default void setF20(boolean f20) {
831        setFunction(20,f20);
832    }
833
834    /**
835     * Set Function 21 Status.
836     * @param f21 true for Function On, false for Function Off.
837     * @deprecated Use {@code setFunction(int functionNum) } instead.
838     */
839    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
840    default void setF21(boolean f21) {
841        setFunction(21,f21);
842    }
843
844    /**
845     * Set Function 22 Status.
846     * @param f22 true for Function On, false for Function Off.
847     * @deprecated Use {@code setFunction(int functionNum) } instead.
848     */
849    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
850    default void setF22(boolean f22) {
851        setFunction(22,f22);
852    }
853
854    /**
855     * Set Function 23 Status.
856     * @param f23 true for Function On, false for Function Off.
857     * @deprecated Use {@code setFunction(int functionNum) } instead.
858     */
859    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
860    default void setF23(boolean f23) {
861        setFunction(23,f23);
862    }
863
864    /**
865     * Set Function 24 Status.
866     * @param f24 true for Function On, false for Function Off.
867     * @deprecated Use {@code setFunction(int functionNum) } instead.
868     */
869    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
870    default void setF24(boolean f24) {
871        setFunction(24,f24);
872    }
873
874    /**
875     * Set Function 25 Status.
876     * @param f25 true for Function On, false for Function Off.
877     * @deprecated Use {@code setFunction(int functionNum) } instead.
878     */
879    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
880    default void setF25(boolean f25) {
881        setFunction(25,f25);
882    }
883
884    /**
885     * Set Function 26 Status.
886     * @param f26 true for Function On, false for Function Off.
887     * @deprecated Use {@code setFunction(int functionNum) } instead.
888     */
889    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
890    default void setF26(boolean f26) {
891        setFunction(26,f26);
892    }
893
894    /**
895     * Set Function 27 Status.
896     * @param f27 true for Function On, false for Function Off.
897     * @deprecated Use {@code setFunction(int functionNum) } instead.
898     */
899    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
900    default void setF27(boolean f27) {
901        setFunction(27,f27);
902    }
903
904    /**
905     * Set Function 28 Status.
906     * @param f28 true for Function On, false for Function Off.
907     * @deprecated Use {@code setFunction(int functionNum) } instead.
908     */
909    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
910    default void setF28(boolean f28) {
911        setFunction(28,f28);
912    }
913
914    // functions momentary status - note that we use the naming for DCC,
915    // though that's not the implication;
916    // see also DccThrottle interface
917
918    /**
919     * Get Momentary Function 0 Status.
920     * @return true for Momentary Function On, else false.
921     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
922     */
923    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
924    default boolean getF0Momentary() {
925        return getFunctionMomentary(0);
926    }
927
928    /**
929     * Get Momentary Function 1 Status.
930     * @return true for Momentary Function On, else false.
931     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
932     */
933    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
934    default boolean getF1Momentary() {
935        return getFunctionMomentary(1);
936    }
937
938    /**
939     * Get Momentary Function 2 Status.
940     * @return true for Momentary Function On, else false.
941     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
942     */
943    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
944    default boolean getF2Momentary() {
945        return getFunctionMomentary(2);
946    }
947
948    /**
949     * Get Momentary Function 3 Status.
950     * @return true for Momentary Function On, else false.
951     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
952     */
953    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
954    default boolean getF3Momentary() {
955        return getFunctionMomentary(3);
956    }
957
958    /**
959     * Get Momentary Function 4 Status.
960     * @return true for Momentary Function On, else false.
961     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
962     */
963    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
964    default boolean getF4Momentary() {
965        return getFunctionMomentary(4);
966    }
967
968    /**
969     * Get Momentary Function 5 Status.
970     * @return true for Momentary Function On, else false.
971     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
972     */
973    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
974    default boolean getF5Momentary() {
975        return getFunctionMomentary(5);
976    }
977
978    /**
979     * Get Momentary Function 6 Status.
980     * @return true for Momentary Function On, else false.
981     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
982     */
983    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
984    default boolean getF6Momentary() {
985        return getFunctionMomentary(6);
986    }
987
988    /**
989     * Get Momentary Function 7 Status.
990     * @return true for Momentary Function On, else false.
991     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
992     */
993    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
994    default boolean getF7Momentary() {
995        return getFunctionMomentary(7);
996    }
997
998    /**
999     * Get Momentary Function 8 Status.
1000     * @return true for Momentary Function On, else false.
1001     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1002     */
1003    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1004    default boolean getF8Momentary() {
1005        return getFunctionMomentary(8);
1006    }
1007
1008    /**
1009     * Get Momentary Function 9 Status.
1010     * @return true for Momentary Function On, else false.
1011     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1012     */
1013    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1014    default boolean getF9Momentary() {
1015        return getFunctionMomentary(9);
1016    }
1017
1018    /**
1019     * Get Momentary Function 10 Status.
1020     * @return true for Momentary Function On, else false.
1021     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1022     */
1023    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1024    default boolean getF10Momentary() {
1025        return getFunctionMomentary(10);
1026    }
1027
1028    /**
1029     * Get Momentary Function 11 Status.
1030     * @return true for Momentary Function On, else false.
1031     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1032     */
1033    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1034    default boolean getF11Momentary() {
1035        return getFunctionMomentary(11);
1036    }
1037
1038    /**
1039     * Get Momentary Function 12 Status.
1040     * @return true for Momentary Function On, else false.
1041     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1042     */
1043    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1044    default boolean getF12Momentary() {
1045        return getFunctionMomentary(12);
1046    }
1047
1048    /**
1049     * Get Momentary Function 13 Status.
1050     * @return true for Momentary Function On, else false.
1051     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1052     */
1053    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1054    default boolean getF13Momentary() {
1055        return getFunctionMomentary(13);
1056    }
1057
1058    /**
1059     * Get Momentary Function 14 Status.
1060     * @return true for Momentary Function On, else false.
1061     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1062     */
1063    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1064    default boolean getF14Momentary() {
1065        return getFunctionMomentary(14);
1066    }
1067
1068    /**
1069     * Get Momentary Function 15 Status.
1070     * @return true for Momentary Function On, else false.
1071     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1072     */
1073    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1074    default boolean getF15Momentary() {
1075        return getFunctionMomentary(15);
1076    }
1077
1078    /**
1079     * Get Momentary Function 16 Status.
1080     * @return true for Momentary Function On, else false.
1081     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1082     */
1083    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1084    default boolean getF16Momentary() {
1085        return getFunctionMomentary(16);
1086    }
1087
1088    /**
1089     * Get Momentary Function 17 Status.
1090     * @return true for Momentary Function On, else false.
1091     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1092     */
1093    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1094    default boolean getF17Momentary() {
1095        return getFunctionMomentary(17);
1096    }
1097
1098    /**
1099     * Get Momentary Function 18 Status.
1100     * @return true for Momentary Function On, else false.
1101     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1102     */
1103    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1104    default boolean getF18Momentary() {
1105        return getFunctionMomentary(18);
1106    }
1107
1108    /**
1109     * Get Momentary Function 19 Status.
1110     * @return true for Momentary Function On, else false.
1111     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1112     */
1113    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1114    default boolean getF19Momentary() {
1115        return getFunctionMomentary(19);
1116    }
1117
1118    /**
1119     * Get Momentary Function 20 Status.
1120     * @return true for Momentary Function On, else false.
1121     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1122     */
1123    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1124    default boolean getF20Momentary() {
1125        return getFunctionMomentary(20);
1126    }
1127
1128    /**
1129     * Get Momentary Function 21 Status.
1130     * @return true for Momentary Function On, else false.
1131     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1132     */
1133    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1134    default boolean getF21Momentary() {
1135        return getFunctionMomentary(21);
1136    }
1137
1138    /**
1139     * Get Momentary Function 22 Status.
1140     * @return true for Momentary Function On, else false.
1141     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1142     */
1143    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1144    default boolean getF22Momentary() {
1145        return getFunctionMomentary(22);
1146    }
1147
1148    /**
1149     * Get Momentary Function 23 Status.
1150     * @return true for Momentary Function On, else false.
1151     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1152     */
1153    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1154    default boolean getF23Momentary() {
1155        return getFunctionMomentary(23);
1156    }
1157
1158    /**
1159     * Get Momentary Function 24 Status.
1160     * @return true for Momentary Function On, else false.
1161     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1162     */
1163    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1164    default boolean getF24Momentary() {
1165        return getFunctionMomentary(24);
1166    }
1167
1168    /**
1169     * Get Momentary Function 25 Status.
1170     * @return true for Momentary Function On, else false.
1171     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1172     */
1173    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1174    default boolean getF25Momentary() {
1175        return getFunctionMomentary(25);
1176    }
1177
1178    /**
1179     * Get Momentary Function 26 Status.
1180     * @return true for Momentary Function On, else false.
1181     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1182     */
1183    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1184    default boolean getF26Momentary() {
1185        return getFunctionMomentary(26);
1186    }
1187
1188    /**
1189     * Get Momentary Function 27 Status.
1190     * @return true for Momentary Function On, else false.
1191     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1192     */
1193    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1194    default boolean getF27Momentary() {
1195        return getFunctionMomentary(27);
1196    }
1197
1198    /**
1199     * Get Momentary Function 28 Status.
1200     * @return true for Momentary Function On, else false.
1201     * @deprecated Use {@code getFunctionMomentary(int functionNum) } instead.
1202     */
1203    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1204    default boolean getF28Momentary() {
1205        return getFunctionMomentary(28);
1206    }
1207
1208    /**
1209     * Set Momentary Function 0 Status.
1210     * @param f0Momentary true for Momentary Function On, else false.
1211     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1212     */
1213    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1214    default void setF0Momentary(boolean f0Momentary) {
1215        setFunctionMomentary(0,f0Momentary);
1216    }
1217
1218    /**
1219     * Set Momentary Function 1 Status.
1220     * @param f1Momentary true for Momentary Function On, else false.
1221     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1222     */
1223    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1224    default void setF1Momentary(boolean f1Momentary) {
1225        setFunctionMomentary(1,f1Momentary);
1226    }
1227
1228    /**
1229     * Set Momentary Function 2 Status.
1230     * @param f2Momentary true for Momentary Function On, else false.
1231     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1232     */
1233    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1234    default void setF2Momentary(boolean f2Momentary) {
1235        setFunctionMomentary(2,f2Momentary);
1236    }
1237
1238    /**
1239     * Set Momentary Function 3 Status.
1240     * @param f3Momentary true for Momentary Function On, else false.
1241     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1242     */
1243    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1244    default void setF3Momentary(boolean f3Momentary) {
1245        setFunctionMomentary(3,f3Momentary);
1246    }
1247
1248    /**
1249     * Set Momentary Function 4 Status.
1250     * @param f4Momentary true for Momentary Function On, else false.
1251     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1252     */
1253    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1254    default void setF4Momentary(boolean f4Momentary) {
1255        setFunctionMomentary(4,f4Momentary);
1256    }
1257
1258    /**
1259     * Set Momentary Function 5 Status.
1260     * @param f5Momentary true for Momentary Function On, else false.
1261     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1262     */
1263    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1264    default void setF5Momentary(boolean f5Momentary) {
1265        setFunctionMomentary(5,f5Momentary);
1266    }
1267
1268    /**
1269     * Set Momentary Function 6 Status.
1270     * @param f6Momentary true for Momentary Function On, else false.
1271     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1272     */
1273    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1274    default void setF6Momentary(boolean f6Momentary) {
1275        setFunctionMomentary(6,f6Momentary);
1276    }
1277
1278    /**
1279     * Set Momentary Function 7 Status.
1280     * @param f7Momentary true for Momentary Function On, else false.
1281     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1282     */
1283    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1284    default void setF7Momentary(boolean f7Momentary) {
1285        setFunctionMomentary(7,f7Momentary);
1286    }
1287
1288    /**
1289     * Set Momentary Function 8 Status.
1290     * @param f8Momentary true for Momentary Function On, else false.
1291     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1292     */
1293    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1294    default void setF8Momentary(boolean f8Momentary) {
1295        setFunctionMomentary(8,f8Momentary);
1296    }
1297
1298    /**
1299     * Set Momentary Function 9 Status.
1300     * @param f9Momentary true for Momentary Function On, else false.
1301     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1302     */
1303    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1304    default void setF9Momentary(boolean f9Momentary) {
1305        setFunctionMomentary(9,f9Momentary);
1306    }
1307
1308    /**
1309     * Set Momentary Function 10 Status.
1310     * @param f10Momentary true for Momentary Function On, else false.
1311     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1312     */
1313    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1314    default void setF10Momentary(boolean f10Momentary) {
1315        setFunctionMomentary(10,f10Momentary);
1316    }
1317
1318    /**
1319     * Set Momentary Function 11 Status.
1320     * @param f11Momentary true for Momentary Function On, else false.
1321     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1322     */
1323    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1324    default void setF11Momentary(boolean f11Momentary) {
1325        setFunctionMomentary(11,f11Momentary);
1326    }
1327
1328    /**
1329     * Set Momentary Function 12 Status.
1330     * @param f12Momentary true for Momentary Function On, else false.
1331     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1332     */
1333    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1334    default void setF12Momentary(boolean f12Momentary) {
1335        setFunctionMomentary(12,f12Momentary);
1336    }
1337
1338    /**
1339     * Set Momentary Function 13 Status.
1340     * @param f13Momentary true for Momentary Function On, else false.
1341     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1342     */
1343    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1344    default void setF13Momentary(boolean f13Momentary) {
1345        setFunctionMomentary(13,f13Momentary);
1346    }
1347
1348    /**
1349     * Set Momentary Function 14 Status.
1350     * @param f14Momentary true for Momentary Function On, else false.
1351     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1352     */
1353    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1354    default void setF14Momentary(boolean f14Momentary) {
1355        setFunctionMomentary(14,f14Momentary);
1356    }
1357
1358    /**
1359     * Set Momentary Function 15 Status.
1360     * @param f15Momentary true for Momentary Function On, else false.
1361     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1362     */
1363    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1364    default void setF15Momentary(boolean f15Momentary) {
1365        setFunctionMomentary(15,f15Momentary);
1366    }
1367
1368    /**
1369     * Set Momentary Function 16 Status.
1370     * @param f16Momentary true for Momentary Function On, else false.
1371     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1372     */
1373    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1374    default void setF16Momentary(boolean f16Momentary) {
1375        setFunctionMomentary(16,f16Momentary);
1376    }
1377
1378    /**
1379     * Set Momentary Function 17 Status.
1380     * @param f17Momentary true for Momentary Function On, else false.
1381     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1382     */
1383    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1384    default void setF17Momentary(boolean f17Momentary) {
1385        setFunctionMomentary(17,f17Momentary);
1386    }
1387
1388    /**
1389     * Set Momentary Function 18 Status.
1390     * @param f18Momentary true for Momentary Function On, else false.
1391     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1392     */
1393    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1394    default void setF18Momentary(boolean f18Momentary) {
1395        setFunctionMomentary(18,f18Momentary);
1396    }
1397
1398    /**
1399     * Set Momentary Function 19 Status.
1400     * @param f19Momentary true for Momentary Function On, else false.
1401     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1402     */
1403    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1404    default void setF19Momentary(boolean f19Momentary) {
1405        setFunctionMomentary(19,f19Momentary);
1406    }
1407
1408    /**
1409     * Set Momentary Function 20 Status.
1410     * @param f20Momentary true for Momentary Function On, else false.
1411     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1412     */
1413    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1414    default void setF20Momentary(boolean f20Momentary) {
1415        setFunctionMomentary(20,f20Momentary);
1416    }
1417
1418    /**
1419     * Set Momentary Function 21 Status.
1420     * @param f21Momentary true for Momentary Function On, else false.
1421     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1422     */
1423    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1424    default void setF21Momentary(boolean f21Momentary) {
1425        setFunctionMomentary(21,f21Momentary);
1426    }
1427
1428    /**
1429     * Set Momentary Function 22 Status.
1430     * @param f22Momentary true for Momentary Function On, else false.
1431     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1432     */
1433    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1434    default void setF22Momentary(boolean f22Momentary) {
1435        setFunctionMomentary(22,f22Momentary);
1436    }
1437
1438    /**
1439     * Set Momentary Function 23 Status.
1440     * @param f23Momentary true for Momentary Function On, else false.
1441     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1442     */
1443    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1444    default void setF23Momentary(boolean f23Momentary) {
1445        setFunctionMomentary(23,f23Momentary);
1446    }
1447
1448    /**
1449     * Set Momentary Function 24 Status.
1450     * @param f24Momentary true for Momentary Function On, else false.
1451     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1452     */
1453    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1454    default void setF24Momentary(boolean f24Momentary) {
1455        setFunctionMomentary(24,f24Momentary);
1456    }
1457
1458    /**
1459     * Set Momentary Function 25 Status.
1460     * @param f25Momentary true for Momentary Function On, else false.
1461     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1462     */
1463    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1464    default void setF25Momentary(boolean f25Momentary) {
1465        setFunctionMomentary(25,f25Momentary);
1466    }
1467
1468    /**
1469     * Set Momentary Function 26 Status.
1470     * @param f26Momentary true for Momentary Function On, else false.
1471     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1472     */
1473    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1474    default void setF26Momentary(boolean f26Momentary) {
1475        setFunctionMomentary(26,f26Momentary);
1476    }
1477
1478    /**
1479     * Set Momentary Function 27 Status.
1480     * @param f27Momentary true for Momentary Function On, else false.
1481     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1482     */
1483    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1484    default void setF27Momentary(boolean f27Momentary) {
1485        setFunctionMomentary(27,f27Momentary);
1486    }
1487
1488    /**
1489     * Set Momentary Function 28 Status.
1490     * @param f28Momentary true for Momentary Function On, else false.
1491     * @deprecated Use {@code setFunctionMomentary(int functionNum) } instead.
1492     */
1493    @Deprecated(since="5.1.2", forRemoval=false) // used in scripts
1494    default void setF28Momentary(boolean f28Momentary) {
1495        setFunctionMomentary(28,f28Momentary);
1496    }
1497
1498    /**
1499     * Locomotive address. The exact format is defined by the specific
1500     * implementation, as subclasses of LocoAddress will contain different
1501     * information.
1502     * <p>
1503     * This is an unbound property.
1504     *
1505     * @return The locomotive address
1506     */
1507    LocoAddress getLocoAddress();
1508
1509    /**
1510     * Not for general use, see {@link #release(ThrottleListener l)} and
1511     * {@link #dispatch(ThrottleListener l)}.
1512     * <p>
1513     * Dispose of object when finished it. This does not free any hardware
1514     * resources used; rather, it just cleans up the software implementation.
1515     * <p>
1516     * Used for handling certain internal error conditions, where the object
1517     * still exists but hardware is not associated with it.
1518     * <p>
1519     * After this, further usage of this Throttle object will result in a
1520     * JmriException.
1521     *
1522     * @param l {@link ThrottleListener} to dispose of
1523     */
1524    void dispose(ThrottleListener l);
1525
1526    /**
1527     * Finished with this Throttle, tell the layout that the locomotive is
1528     * available for reuse/reallocation by somebody else.
1529     * <p>
1530     * After this, further usage of this Throttle object will result in a
1531     * JmriException. Do not call dispose after release.
1532     * <p>
1533     * Normally, release ends with a call to dispose.
1534     *
1535     * @param l {@link ThrottleListener} to release. May be null if no
1536     *          {@link ThrottleListener} is currently held.
1537     */
1538    void release(ThrottleListener l);
1539
1540    /**
1541     * Finished with this Throttle, tell the layout that the locomotive is
1542     * available for reuse/reallocation by somebody else. If possible, tell the
1543     * layout that this locomotive has been dispatched to another user. Not all
1544     * layouts will implement this, in which case it is synonymous with
1545     * {@link #release(jmri.ThrottleListener)}.
1546     * <p>
1547     * After this, further usage of this Throttle object will result in a
1548     * JmriException.
1549     * <p>
1550     * Normally, dispatch ends with a call to dispose.
1551     *
1552     * @param l {@link ThrottleListener} to dispatch
1553     */
1554    void dispatch(ThrottleListener l);
1555
1556    void setRosterEntry(BasicRosterEntry re);
1557
1558    BasicRosterEntry getRosterEntry();
1559
1560    /**
1561     * Notify listeners that a Throttle has Release enabled or disabled.
1562     * <p>
1563     * For systems where release availability is variable.
1564     *
1565     * @param newVal true if Release enabled, else false
1566     */
1567    void notifyThrottleReleaseEnabled(boolean newVal);
1568
1569    /**
1570     * Notify listeners that a Throttle has Dispatch enabled or disabled.
1571     * <p>
1572     * For systems where dispatch availability is variable.
1573     *
1574     * @param newVal true if Dispatch enabled, else false
1575     */
1576    void notifyThrottleDispatchEnabled(boolean newVal);
1577}