|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractPortController
public abstract class AbstractPortController
Provide an abstract base for *PortController classes.
This is complicated by the lack of multiple inheritance. SerialPortAdapter is an Interface, and it's implementing classes also inherit from various PortController types. But we want some common behaviours for those, so we put them here.
SerialPortAdapter| Field Summary | |
|---|---|
protected static org.apache.log4j.Category |
log
|
protected String |
mBaudRate
|
protected String |
mOpt1
|
protected String |
mOpt2
|
protected String |
mPort
|
| Constructor Summary | |
|---|---|
AbstractPortController()
|
|
| Method Summary | |
|---|---|
void |
configureBaudRate(String rate)
Set the baud rate. |
void |
configureOption1(String value)
Set the second port option. |
void |
configureOption2(String value)
Set the second port option. |
int |
currentBaudNumber(String currentBaudRate)
Convert a baud rate string to a number. |
String |
getCurrentBaudRate()
|
String |
getCurrentOption1Setting()
|
String |
getCurrentOption2Setting()
Get current option 2 value |
String |
getCurrentPortName()
|
abstract DataInputStream |
getInputStream()
|
abstract DataOutputStream |
getOutputStream()
|
String |
handlePortBusy(javax.comm.PortInUseException p,
String portName,
org.apache.log4j.Category log)
Standard error handling for port-busy case |
String |
handlePortNotFound(javax.comm.NoSuchPortException p,
String portName,
org.apache.log4j.Category log)
Standard error handling for port-not-found case |
String |
option1Name()
Get a String that says what Option 1 represents May be an empty string, but will not be null |
String |
option2Name()
Get a String that says what Option 2 represents May be an empty string, but will not be null |
void |
setPort(String port)
Remember the associated port name |
abstract boolean |
status()
Query the status of this connection. |
int[] |
validBaudNumber()
Get an array of valid baud rates as integers. |
String[] |
validOption1()
Get an array of valid values for "option 1"; used to display valid options. |
String[] |
validOption2()
Get an array of valid values for "option 2"; used to display valid options. |
| 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 |
|---|
configure, getPortNames, openPort, validBaudRates |
| Field Detail |
|---|
protected String mPort
protected String mBaudRate
protected String mOpt1
protected String mOpt2
protected static org.apache.log4j.Category log
| Constructor Detail |
|---|
public AbstractPortController()
| Method Detail |
|---|
public abstract DataInputStream getInputStream()
public abstract DataOutputStream getOutputStream()
public abstract boolean status()
PortAdapter
status in interface PortAdapterstatus in interface SerialPortAdapter
public String handlePortBusy(javax.comm.PortInUseException p,
String portName,
org.apache.log4j.Category log)
handlePortBusy in interface SerialPortAdapterAbstractPortController
public String handlePortNotFound(javax.comm.NoSuchPortException p,
String portName,
org.apache.log4j.Category log)
public void setPort(String port)
SerialPortAdapter
setPort in interface SerialPortAdapterpublic String getCurrentPortName()
getCurrentPortName in interface SerialPortAdapterpublic void configureBaudRate(String rate)
configureBaudRate in interface SerialPortAdapterpublic String getCurrentBaudRate()
getCurrentBaudRate in interface SerialPortAdapterpublic int[] validBaudNumber()
public int currentBaudNumber(String currentBaudRate)
public String[] validOption1()
validOption1 in interface SerialPortAdapterpublic String option1Name()
option1Name in interface SerialPortAdapterpublic void configureOption1(String value)
configureOption1 in interface SerialPortAdapterpublic String getCurrentOption1Setting()
getCurrentOption1Setting in interface SerialPortAdapterpublic String[] validOption2()
validOption2 in interface SerialPortAdapterpublic String option2Name()
option2Name in interface SerialPortAdapterpublic void configureOption2(String value)
configureOption2 in interface SerialPortAdapterpublic String getCurrentOption2Setting()
SerialPortAdapter
getCurrentOption2Setting in interface SerialPortAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||