jmri.jmrix.loconet.pr3
Class PR3Adapter

java.lang.Object
  extended by jmri.jmrix.AbstractPortController
      extended by jmri.jmrix.loconet.LnPortController
          extended by jmri.jmrix.loconet.locobuffer.LocoBufferAdapter
              extended by jmri.jmrix.loconet.pr3.PR3Adapter
All Implemented Interfaces:
PortAdapter, SerialPortAdapter

public class PR3Adapter
extends LocoBufferAdapter

Update the code in jmri.jmrix.loconet.locobuffer so that it refers to the switch settings on the new Digitrax PR3

Author:
Bob Jacobsen Copyright (C) 2004, 2005, 2006, 2008

Field Summary
protected  String[] validSpeeds
           
protected  int[] validSpeedValues
           
 
Fields inherited from class jmri.jmrix.loconet.locobuffer.LocoBufferAdapter
validOption1
 
Fields inherited from class jmri.jmrix.loconet.LnPortController
commandStationName, commandStationNames, mCanRead, mProgPowersOff
 
Fields inherited from class jmri.jmrix.AbstractPortController
mBaudRate, mOpt1, mOpt2, mPort
 
Constructor Summary
PR3Adapter()
           
 
Method Summary
 void configure()
          Set up all of the other objects to operate with a PR3 connected to this port.
static void configureManagersMS100(LnTrafficController controller)
          Configure the subset of LocoNet managers valid for the PR3 in MS100 mode.
static void configureManagersPR2()
          Configure the subset of LocoNet managers valid for the PR3 in PR2 mode.
static boolean hasInstance()
           
static LocoBufferAdapter instance()
           
protected  void setSerialPort(SerialPort activeSerialPort)
          Always use flow control, not considered a user-settable option
 int[] validBaudNumber()
          Get an array of valid baud rates as integers.
 String[] validBaudRates()
          Get an array of valid baud rates.
 String[] validOption2()
          The PR3 can be used in numerous modes, so handle that
 
Methods inherited from class jmri.jmrix.loconet.locobuffer.LocoBufferAdapter
configureOption2, getInputStream, getOutputStream, getPortNames, okToSend, openPort, option1Name, option2Name, status, validOption1
 
Methods inherited from class jmri.jmrix.loconet.LnPortController
configureCommandStation, configureManagers, setCommandStationType
 
Methods inherited from class jmri.jmrix.AbstractPortController
configureBaudRate, configureOption1, currentBaudNumber, getCurrentBaudRate, getCurrentOption1Setting, getCurrentOption2Setting, getCurrentPortName, handlePortBusy, handlePortNotFound, reloadDriver, setPort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.jmrix.SerialPortAdapter
configureBaudRate, configureOption1, getCurrentBaudRate, getCurrentOption1Setting, getCurrentOption2Setting, getCurrentPortName, handlePortBusy, setPort
 

Field Detail

validSpeeds

protected String[] validSpeeds

validSpeedValues

protected int[] validSpeedValues
Constructor Detail

PR3Adapter

public PR3Adapter()
Method Detail

setSerialPort

protected void setSerialPort(SerialPort activeSerialPort)
                      throws UnsupportedCommOperationException
Always use flow control, not considered a user-settable option

Overrides:
setSerialPort in class LocoBufferAdapter
Throws:
UnsupportedCommOperationException

configure

public void configure()
Set up all of the other objects to operate with a PR3 connected to this port. This overrides the version in loconet.locobuffer, but it has to duplicate much of the functionality there, so the code is basically copied.

Specified by:
configure in interface PortAdapter
Specified by:
configure in interface SerialPortAdapter
Overrides:
configure in class LocoBufferAdapter

configureManagersPR2

public static void configureManagersPR2()
Configure the subset of LocoNet managers valid for the PR3 in PR2 mode. This is used instead of the method in LnPortController, which is more general.


configureManagersMS100

public static void configureManagersMS100(LnTrafficController controller)
Configure the subset of LocoNet managers valid for the PR3 in MS100 mode. This is used instead of the method in LnPortController, which is more general.


validBaudRates

public String[] validBaudRates()
Get an array of valid baud rates.

Specified by:
validBaudRates in interface SerialPortAdapter
Overrides:
validBaudRates in class LocoBufferAdapter

validBaudNumber

public int[] validBaudNumber()
Get an array of valid baud rates as integers. This allows subclasses to change the arrays of speeds.

Overrides:
validBaudNumber in class LocoBufferAdapter

validOption2

public String[] validOption2()
The PR3 can be used in numerous modes, so handle that

Specified by:
validOption2 in interface PortAdapter
Specified by:
validOption2 in interface SerialPortAdapter
Overrides:
validOption2 in class LocoBufferAdapter

hasInstance

public static boolean hasInstance()

instance

public static LocoBufferAdapter instance()


Copyright © 1997 - 2009 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