jmri.jmrix.lenz
Class LenzCommandStation

java.lang.Object
  extended by jmri.jmrix.lenz.LenzCommandStation
All Implemented Interfaces:
CommandStation, DccCommandStation
Direct Known Subclasses:
HornbyEliteCommandStation

public class LenzCommandStation
extends Object
implements DccCommandStation, CommandStation

Defines the standard/common routines used in multiple classes related to the a Lenz Command Station, on an XPressNet network.

Author:
Bob Jacobsen Copyright (C) 2001 Portions by Paul Bender Copyright (C) 2003

Constructor Summary
LenzCommandStation()
           
 
Method Summary
 float getCommandStationSoftwareVersion()
          return the CS Software Version
 float getCommandStationSoftwareVersionBCD()
          return the CS Software Version in BCD (for use in comparisons)
 int getCommandStationType()
          return the CS Type
static int getDCCAddressHigh(int address)
          Get the Upper byte of a locomotive address from the decimal locomotive address
static int getDCCAddressLow(int address)
          Get the Lower byte of a locomotive address from the decimal locomotive address
 boolean getHasServiceMode()
          Lenz does use a service mode
 boolean getInServiceMode()
          If this command station has a service mode, is the command station currently in that mode?
 String getVersionString()
          Provides the version string returned during the initial check.
 boolean isOpsModePossible()
          XPressNet command station does provide Ops Mode We should make this return false based on what command station we're using but for now, we'll return true
 void sendPacket(byte[] packet, int repeats)
          Send a specific packet to the rails.
 void setCommandStationSoftwareVersion(float v)
          set the CS Software Version
 void setCommandStationSoftwareVersion(XNetReply l)
          Set the CS Software Version based on an XPressNet Message
 void setCommandStationType(int t)
          set the CS Type
 void setCommandStationType(XNetReply l)
          Set the CS type based on an XPressNet Message
 void setTrafficController(XNetTrafficController tc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LenzCommandStation

public LenzCommandStation()
Method Detail

getCommandStationType

public int getCommandStationType()
return the CS Type


setCommandStationType

public void setCommandStationType(int t)
set the CS Type


setCommandStationType

public void setCommandStationType(XNetReply l)
Set the CS type based on an XPressNet Message


getCommandStationSoftwareVersion

public float getCommandStationSoftwareVersion()
return the CS Software Version


getCommandStationSoftwareVersionBCD

public float getCommandStationSoftwareVersionBCD()
return the CS Software Version in BCD (for use in comparisons)


setCommandStationSoftwareVersion

public void setCommandStationSoftwareVersion(float v)
set the CS Software Version


setCommandStationSoftwareVersion

public void setCommandStationSoftwareVersion(XNetReply l)
Set the CS Software Version based on an XPressNet Message


getVersionString

public String getVersionString()
Provides the version string returned during the initial check. This function is not yet implemented...

Specified by:
getVersionString in interface DccCommandStation

getHasServiceMode

public boolean getHasServiceMode()
Lenz does use a service mode

Specified by:
getHasServiceMode in interface DccCommandStation

getInServiceMode

public boolean getInServiceMode()
If this command station has a service mode, is the command station currently in that mode?

Specified by:
getInServiceMode in interface DccCommandStation

isOpsModePossible

public boolean isOpsModePossible()
XPressNet command station does provide Ops Mode We should make this return false based on what command station we're using but for now, we'll return true


getDCCAddressLow

public static int getDCCAddressLow(int address)
Get the Lower byte of a locomotive address from the decimal locomotive address


getDCCAddressHigh

public static int getDCCAddressHigh(int address)
Get the Upper byte of a locomotive address from the decimal locomotive address


sendPacket

public void sendPacket(byte[] packet,
                       int repeats)
Send a specific packet to the rails.

Specified by:
sendPacket in interface CommandStation
Parameters:
packet - Byte array representing the packet, including the error-correction byte. Must not be null.
repeats - Number of times to repeat the transmission.

setTrafficController

public void setTrafficController(XNetTrafficController tc)


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads