Package jmri
Class PushbuttonPacket
java.lang.Object
jmri.PushbuttonPacket
Generates an NMRA packet containing the correct payload to enable or disable
pushbutton lockout. Currently supports the following Decoders NCE CVP AD4
NCE is the easiest to implement, CV556 = 0 disable lockout, CV556 = 1 enable
lockout
CVP is a bit tricker, CV514 controls the lockout for four turnouts. Each
turnout can have one or two button controls. Therefore the user must specify
if they are using one or two buttons for each turnout.
From the CVP user manual:
Function CV514 Lock all inputs 0 Unlock 1 1 Unlock 2 4 Unlock 3 16 Unlock 4
64 Unlock all 85 Enable 2 button 255
This routine assumes that for two button operations the following table is
true:
Lock all inputs 0 Unlock 1 3 Unlock 2 12 Unlock 3 48 Unlock 4 192 Unlock all
255
Each CVP can operate up to four turnouts, lucky for us, they are sequential.
Also note that CVP decoder's use the old legacy format for ops mode
programming.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]static byte[]pushbuttonPkt(String prefix, int turnoutNum, boolean locked)
-
Field Details
-
unknown
Valid stationary decoder names- See Also:
-
NCEname
- See Also:
-
CVP_1Bname
- See Also:
-
CVP_2Bname
- See Also:
-
-
Constructor Details
-
PushbuttonPacket
public PushbuttonPacket()
-
-
Method Details
-
pushbuttonPkt
- Parameters:
prefix- system prefix.turnoutNum- turnout number.locked- true if locked, else false.- Returns:
- a DCC packet.
- Throws:
IllegalArgumentException- if input not OK
-
getValidDecoderNames
-