|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractPortController
jmri.jmrix.AbstractSerialPortController
public abstract class AbstractSerialPortController
Provide an abstract base for *PortController classes.
This is complicated by the lack of multiple inheritance. SerialPortAdapter is an Interface, and its 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 Logger |
log
|
protected String |
mBaudRate
|
protected String |
mPort
|
| Fields inherited from class jmri.jmrix.AbstractPortController |
|---|
mDisabled, mManufacturer, mOpt1, mOpt2, opened |
| Constructor Summary | |
|---|---|
AbstractSerialPortController()
|
|
| Method Summary | |
|---|---|
void |
configureBaudRate(String rate)
Set the baud rate. |
int |
currentBaudNumber(String currentBaudRate)
Convert a baud rate string to a number. |
void |
dispose()
|
String |
getCurrentBaudRate()
|
String |
getCurrentPortName()
|
Vector<String> |
getPortNames()
Provide a vector of valid port names, each a String. |
SystemConnectionMemo |
getSystemConnectionMemo()
|
String |
handlePortBusy(PortInUseException p,
String portName,
Logger log)
Standard error handling for port-busy case |
String |
handlePortNotFound(NoSuchPortException p,
String portName,
Logger log)
Standard error handling for port-not-found case |
void |
setDisabled(boolean disabled)
Sets whether the connection is disabled |
void |
setPort(String port)
Remember the associated port name |
int[] |
validBaudNumber()
Get an array of valid baud rates as integers. |
| Methods inherited from class jmri.jmrix.AbstractPortController |
|---|
configureOption1, configureOption2, getCurrentOption1Setting, getCurrentOption2Setting, getDisabled, getInputStream, getManufacturer, getOutputStream, option1Name, option2Name, setManufacturer, status, validOption1, validOption2 |
| 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, configureOption1, configureOption2, getCurrentOption1Setting, getCurrentOption2Setting, getManufacturer, openPort, option1Name, option2Name, setManufacturer, status, validBaudRates, validOption1, validOption2 |
| Methods inherited from interface jmri.jmrix.PortAdapter |
|---|
getDisabled, getInputStream, getOutputStream |
| Field Detail |
|---|
protected String mPort
protected String mBaudRate
protected static final Logger log
| Constructor Detail |
|---|
public AbstractSerialPortController()
| Method Detail |
|---|
public String handlePortBusy(PortInUseException p,
String portName,
Logger log)
handlePortBusy in interface SerialPortAdapterAbstractSerialPortController
public String handlePortNotFound(NoSuchPortException p,
String portName,
Logger log)
public void setPort(String port)
SerialPortAdapter
setPort in interface SerialPortAdapterpublic String getCurrentPortName()
getCurrentPortName in interface PortAdaptergetCurrentPortName in interface SerialPortAdaptergetCurrentPortName in class AbstractPortControllerpublic void configureBaudRate(String rate)
configureBaudRate in interface SerialPortAdapterpublic String getCurrentBaudRate()
getCurrentBaudRate in interface SerialPortAdapterpublic int[] validBaudNumber()
public int currentBaudNumber(String currentBaudRate)
public Vector<String> getPortNames()
SerialPortAdapter
getPortNames in interface SerialPortAdapterpublic SystemConnectionMemo getSystemConnectionMemo()
getSystemConnectionMemo in interface PortAdaptergetSystemConnectionMemo in class AbstractPortControllerpublic void setDisabled(boolean disabled)
PortAdapter
setDisabled in interface PortAdaptersetDisabled in class AbstractPortControllerpublic void dispose()
dispose in interface PortAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||