|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractPortController
jmri.jmrix.AbstractSerialPortController
jmri.jmrix.loconet.LnPortController
jmri.jmrix.loconet.hexfile.LnHexFilePort
public class LnHexFilePort
LnHexFilePort implements a LnPortController via a ASCII-hex input file. See below for the file format There are user-level controls for send next message how long to wait between messages An object of this class should run in a thread of its own so that it can fill the output pipe as needed. The input file is expected to have one message per line. Each line can contain as many bytes as needed, each represented by two Hex characters and separated by a space. Variable whitespace is not (yet) supported
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jmri.jmrix.AbstractPortController |
|---|
AbstractPortController.Option |
| Field Summary | |
|---|---|
(package private) static org.slf4j.Logger |
log
|
(package private) BufferedReader |
sFile
|
| Fields inherited from class jmri.jmrix.loconet.LnPortController |
|---|
adaptermemo, commandStationName, commandStationNames, mCanRead, mProgPowersOff, mTurnoutExtraSpace, mTurnoutNoRetry |
| Fields inherited from class jmri.jmrix.AbstractSerialPortController |
|---|
mBaudRate, mPort |
| Fields inherited from class jmri.jmrix.AbstractPortController |
|---|
allowConnectionRecovery, mDisabled, mManufacturer, opened, option1Name, option2Name, option3Name, option4Name, options, reconnectinterval, retryAttempts |
| Constructor Summary | |
|---|---|
LnHexFilePort()
|
|
| Method Summary | |
|---|---|
void |
configure()
Configure all of the other jmrix widgets needed to work with this adapter |
void |
configureOption3(String value)
Set the third port option. |
void |
connect()
Open the connection |
void |
dispose()
|
LocoNetSystemConnectionMemo |
getAdapterMemo()
|
DataInputStream |
getInputStream()
|
DataOutputStream |
getOutputStream()
|
Vector<String> |
getPortNames()
Provide a vector of valid port names, each a String. |
LocoNetSystemConnectionMemo |
getSystemConnectionMemo()
|
void |
load(File file)
|
boolean |
okToSend()
Can the port accept additional characters? |
String |
openPort(String portName,
String appName)
Open a specified port. |
String |
option3Name()
Get a String that says what Option 3 represents May be an empty string, but will not be null |
void |
run()
|
boolean |
running()
|
void |
setDelay(int newDelay)
Provide a new message delay value, but don't allow it to go below 2 msec. |
boolean |
status()
Check that this object is ready to operate. |
String[] |
validBaudRates()
Get an array of valid baud rates; used to display valid options. |
String[] |
validOption3()
Get an array of valid values for "option 3"; used to display valid options. |
| Methods inherited from class jmri.jmrix.loconet.LnPortController |
|---|
setCommandStationType, setDisabled, setTurnoutHandling |
| Methods inherited from class jmri.jmrix.AbstractSerialPortController |
|---|
closeConnection, configureBaudRate, currentBaudNumber, getCurrentBaudRate, getCurrentPortName, handlePortBusy, handlePortNotFound, reconnect, recover, resetupConnection, setPort, validBaudNumber |
| Methods inherited from class jmri.jmrix.AbstractPortController |
|---|
configureOption1, configureOption2, configureOption4, getDisabled, getManufacturer, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, isOptionAdvanced, safeSleep, setClosed, setManufacturer, setOpened, setOptionState |
| 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, configureOption2, configureOption4, getCurrentBaudRate, getCurrentPortName, getManufacturer, handlePortBusy, setManufacturer, setPort |
| Methods inherited from interface jmri.jmrix.PortAdapter |
|---|
getDisabled, getOption1Name, getOption2Name, getOption3Name, getOption4Name, getOptionChoices, getOptionDisplayName, getOptions, getOptionState, isOptionAdvanced, recover, setDisabled, setOptionState |
| Field Detail |
|---|
BufferedReader sFile
static org.slf4j.Logger log
| Constructor Detail |
|---|
public LnHexFilePort()
| Method Detail |
|---|
public void load(File file)
public void connect()
throws Exception
PortAdapter
connect in interface PortAdapterconnect in class AbstractSerialPortControllerExceptionpublic void run()
run in interface Runnablepublic void setDelay(int newDelay)
public DataInputStream getInputStream()
getInputStream in interface PortAdaptergetInputStream in class LnPortControllerpublic DataOutputStream getOutputStream()
getOutputStream in interface PortAdaptergetOutputStream in class LnPortControllerpublic boolean status()
LnPortController
status in interface PortAdapterstatus in interface SerialPortAdapterstatus in class LnPortControllerpublic boolean running()
public boolean okToSend()
LnPortControllerProvide a default implementation for the MS100, etc, in which this is _always_ true, as we rely on the queueing in the port itself.
okToSend in class LnPortControllerpublic Vector<String> getPortNames()
SerialPortAdapter
getPortNames in interface SerialPortAdaptergetPortNames in class AbstractSerialPortController
public String openPort(String portName,
String appName)
SerialPortAdapter
openPort in interface SerialPortAdapterpublic void configure()
SerialPortAdapter
configure in interface PortAdapterconfigure in interface SerialPortAdapterpublic String[] validBaudRates()
SerialPortAdapter
validBaudRates in interface SerialPortAdapterpublic String[] validOption3()
public String option3Name()
public void configureOption3(String value)
configureOption3 in interface PortAdapterconfigureOption3 in interface SerialPortAdapterconfigureOption3 in class AbstractPortControllerpublic void dispose()
dispose in interface PortAdapterdispose in class AbstractSerialPortControllerpublic LocoNetSystemConnectionMemo getAdapterMemo()
public LocoNetSystemConnectionMemo getSystemConnectionMemo()
getSystemConnectionMemo in interface PortAdaptergetSystemConnectionMemo in class AbstractSerialPortController
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||