Package jmri.jmrix.easydcc
Class EasyDccMessage
- java.lang.Object
-
- jmri.jmrix.AbstractMessage
-
- jmri.jmrix.AbstractMRMessage
-
- jmri.jmrix.easydcc.EasyDccMessage
-
- All Implemented Interfaces:
Message
public class EasyDccMessage extends AbstractMRMessage
Encodes a message to an EasyDCC command station.The
EasyDccReplyclass handles the response from the command station.
-
-
Field Summary
Fields Modifier and Type Field Description protected static intLONG_TIMEOUT-
Fields inherited from class jmri.jmrix.AbstractMRMessage
SHORT_TIMEOUT
-
Fields inherited from class jmri.jmrix.AbstractMessage
_dataChars, _nDataChars
-
-
Constructor Summary
Constructors Constructor Description EasyDccMessage()EasyDccMessage(int i)EasyDccMessage(java.lang.String s)EasyDccMessage(EasyDccMessage m)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EasyDccMessagegetAddConsistNormal(int ConsistAddress, DccLocoAddress LocoAddress)Get a static message to add a locomotive to a Standard Consist in the normal direction.static EasyDccMessagegetAddConsistReverse(int ConsistAddress, DccLocoAddress LocoAddress)Get a static message to add a locomotive to a Standard Consist in the reverse direction.static EasyDccMessagegetDisplayConsist(int ConsistAddress)Get a static message to display a Standard Consist.static EasyDccMessagegetEnableMain()static EasyDccMessagegetExitProgMode()static EasyDccMessagegetKillConsist(int ConsistAddress)Get a static message to delete a Standard Consist.static EasyDccMessagegetKillMain()static EasyDccMessagegetProgMode()static EasyDccMessagegetReadPagedCV(int cv)static EasyDccMessagegetReadRegister(int reg)static EasyDccMessagegetSubtractConsist(int ConsistAddress, DccLocoAddress LocoAddress)Get a static message to subtract a locomotive from a Standard Consist.static EasyDccMessagegetWritePagedCV(int cv, int val)static EasyDccMessagegetWriteRegister(int reg, int val)booleanisEnableMain()booleanisKillMain()-
Methods inherited from class jmri.jmrix.AbstractMRMessage
addIntAsFourHex, addIntAsThree, addIntAsThreeHex, addIntAsTwoHex, getNeededMode, getOpCode, getOpCodeHex, getRetries, getTimeout, isBinary, replyExpected, setBinary, setNeededMode, setOpCode, setRetries, setTimeout, toString
-
Methods inherited from class jmri.jmrix.AbstractMessage
equals, getElement, getNumDataElements, hashCode, setElement
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.jmrix.Message
toMonitorString
-
-
-
-
Field Detail
-
LONG_TIMEOUT
protected static final int LONG_TIMEOUT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EasyDccMessage
public EasyDccMessage()
-
EasyDccMessage
public EasyDccMessage(int i)
-
EasyDccMessage
public EasyDccMessage(EasyDccMessage m)
-
EasyDccMessage
public EasyDccMessage(java.lang.String s)
-
-
Method Detail
-
isKillMain
public boolean isKillMain()
-
isEnableMain
public boolean isEnableMain()
-
getEnableMain
public static EasyDccMessage getEnableMain()
-
getKillMain
public static EasyDccMessage getKillMain()
-
getAddConsistNormal
public static EasyDccMessage getAddConsistNormal(int ConsistAddress, DccLocoAddress LocoAddress)
Get a static message to add a locomotive to a Standard Consist in the normal direction.- Parameters:
ConsistAddress- a consist address in the range 1-255LocoAddress- a jmri.DccLocoAddress object representing the locomotive to add- Returns:
- an EasyDccMessage of the form GN cc llll
-
getAddConsistReverse
public static EasyDccMessage getAddConsistReverse(int ConsistAddress, DccLocoAddress LocoAddress)
Get a static message to add a locomotive to a Standard Consist in the reverse direction.- Parameters:
ConsistAddress- a consist address in the range 1-255LocoAddress- a jmri.DccLocoAddress object representing the locomotive to add- Returns:
- an EasyDccMessage of the form GS cc llll
-
getSubtractConsist
public static EasyDccMessage getSubtractConsist(int ConsistAddress, DccLocoAddress LocoAddress)
Get a static message to subtract a locomotive from a Standard Consist.- Parameters:
ConsistAddress- a consist address in the range 1-255LocoAddress- a jmri.DccLocoAddress object representing the locomotive to remove- Returns:
- an EasyDccMessage of the form GS cc llll
-
getKillConsist
public static EasyDccMessage getKillConsist(int ConsistAddress)
Get a static message to delete a Standard Consist.- Parameters:
ConsistAddress- a consist address in the range 1-255- Returns:
- an EasyDccMessage of the form GK cc
-
getDisplayConsist
public static EasyDccMessage getDisplayConsist(int ConsistAddress)
Get a static message to display a Standard Consist.- Parameters:
ConsistAddress- a consist address in the range 1-255- Returns:
- an EasyDccMessage of the form GD cc
-
getProgMode
public static EasyDccMessage getProgMode()
-
getExitProgMode
public static EasyDccMessage getExitProgMode()
-
getReadPagedCV
public static EasyDccMessage getReadPagedCV(int cv)
-
getWritePagedCV
public static EasyDccMessage getWritePagedCV(int cv, int val)
-
getReadRegister
public static EasyDccMessage getReadRegister(int reg)
-
getWriteRegister
public static EasyDccMessage getWriteRegister(int reg, int val)
-
-