Package jmri.jmrix.lenz
Class LenzCommandStation
java.lang.Object
jmri.jmrix.lenz.LenzCommandStation
- All Implemented Interfaces:
CommandStation
- Direct Known Subclasses:
HornbyEliteCommandStation,RocoCommandStation
Defines the standard/common routines used in multiple classes related to the
a Lenz Command Station, on an XpressNet network.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcalcLocoAddress(int AH, int AL) We need to calculate the locomotive address when doing the translations back to text.floatGet the CS Software Version.floatGet the CS Software Version in BCD (for use in comparisons).intReturn the CS Type.static intgetDCCAddressHigh(int address) Get the Upper byte of a locomotive address from the decimal locomotive address.static intgetDCCAddressLow(int address) Get the Lower byte of a locomotive address from the decimal locomotive address.Provide the version string returned during the initial check.booleanXpressNet command station does provide Ops Mode.booleansendPacket(byte[] packet, int repeats) Send a specific packet to the rails.voidsetCommandStationSoftwareVersion(float v) Set the CS Software Version.voidSet the CS Software Version based on an XpressNet Message.voidsetCommandStationType(int t) Set the CS Type.voidSet the CS Type based on an XpressNet Message.voidvoidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.CommandStation
sendAccSignalDecoderPkt, sendAltAccSignalDecoderPkt
-
Field Details
-
adaptermemo
-
-
Constructor Details
-
LenzCommandStation
public LenzCommandStation()
-
-
Method Details
-
getCommandStationType
Return the CS Type.- Returns:
- CS type.
-
setCommandStationType
Set the CS Type.- Parameters:
t- CS type.
-
setCommandStationType
Set the CS Type based on an XpressNet Message.- Parameters:
l- XNetReply containing the CS type.
-
getCommandStationSoftwareVersion
Get the CS Software Version.- Returns:
- software version.
-
getCommandStationSoftwareVersionBCD
Get the CS Software Version in BCD (for use in comparisons).- Returns:
- software version.
-
setCommandStationSoftwareVersion
Set the CS Software Version.- Parameters:
v- software version.
-
setCommandStationSoftwareVersion
Set the CS Software Version based on an XpressNet Message.- Parameters:
l- reply containing CS version.
-
getVersionString
Provide the version string returned during the initial check.- Returns:
- human readable version string.
-
isOpsModePossible
XpressNet command station does provide Ops Mode.- Returns:
- true if CS type 1 or 2, else false.
-
getDCCAddressLow
Get the Lower byte of a locomotive address from the decimal locomotive address.- Parameters:
address- loco address.- Returns:
- low address byte including DCC offset.
-
getDCCAddressHigh
Get the Upper byte of a locomotive address from the decimal locomotive address.- Parameters:
address- loco address.- Returns:
- upper byte after DCC offset.
-
calcLocoAddress
We need to calculate the locomotive address when doing the translations back to text. XpressNet Messages will have these as two elements, which need to get translated back into a single address by reversing the formulas used to calculate them in the first place.- Parameters:
AH- the high order byte of the addressAL- the low order byte of the address- Returns:
- the address as an integer.
-
sendPacket
Send a specific packet to the rails.- Specified by:
sendPacketin interfaceCommandStation- Parameters:
packet- Byte array representing the packet, including the error-correction byte. Must not be null.repeats- Number of times to repeat the transmission.- Returns:
trueif the operation succeeds,falseotherwise.
-
setTrafficController
-
setSystemConnectionMemo
-
getUserName
- Specified by:
getUserNamein interfaceCommandStation
-
getSystemPrefix
- Specified by:
getSystemPrefixin interfaceCommandStation
-