|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractMRTrafficController
jmri.jmrix.mrc.MrcTrafficController
public class MrcTrafficController
Converts Stream-based I/O to/from MRC messages. The "MrcInterface" side sends/receives message objects.
The connection to a MrcPortController is via a pair of *Streams, which then carry sequences of characters for transmission. Note that this processing is handled in an independent thread.
This handles the state transistions, based on the necessary state in each message.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jmri.jmrix.AbstractMRTrafficController |
|---|
AbstractMRTrafficController.RcvNotifier, AbstractMRTrafficController.XmtNotifier |
| Field Summary | |
|---|---|
protected static MrcTrafficController |
self
|
| Fields inherited from class jmri.jmrix.AbstractMRTrafficController |
|---|
allowUnexpectedReply, cmdListeners, controller, flushReceiveChars, IDLESTATE, istream, mCurrentMode, mCurrentState, mLastSender, mWaitBeforePoll, NORMALMODE, NOTIFIEDSTATE, OKSENDMSGSTATE, ostream, PROGRAMINGMODE, replyInDispatch, WAITMSGREPLYSTATE, WAITREPLYINNORMMODESTATE, WAITREPLYINPROGMODESTATE, xmtRunnable |
| Constructor Summary | |
|---|---|
MrcTrafficController()
|
|
| Method Summary | |
|---|---|
void |
addMrcListener(MrcListener l)
|
protected boolean |
endOfMessage(AbstractMRReply msg)
|
protected AbstractMRMessage |
enterNormalMode()
|
protected AbstractMRMessage |
enterProgMode()
|
protected void |
forwardMessage(AbstractMRListener client,
AbstractMRMessage m)
Forward a MrcMessage to all registered MrcInterface listeners. |
protected void |
forwardReply(AbstractMRListener client,
AbstractMRReply m)
Forward a MrcReply to all registered MrcInterface listeners. |
static MrcTrafficController |
instance()
static function returning the MrcTrafficController instance to use. |
protected AbstractMRReply |
newReply()
|
protected AbstractMRMessage |
pollMessage()
Invoked if it's appropriate to do low-priority polling of the command station, this should return the next message to send, or null if the TC should just sleep. |
protected AbstractMRListener |
pollReplyHandler()
|
void |
removeMrcListener(MrcListener l)
|
void |
sendMrcMessage(MrcMessage m,
MrcListener reply)
Forward a preformatted message to the actual interface. |
protected void |
setInstance()
|
void |
setSensorManager(SensorManager m)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.jmrix.mrc.MrcInterface |
|---|
status |
| Field Detail |
|---|
protected static MrcTrafficController self
| Constructor Detail |
|---|
public MrcTrafficController()
| Method Detail |
|---|
public void addMrcListener(MrcListener l)
addMrcListener in interface MrcInterfacepublic void removeMrcListener(MrcListener l)
removeMrcListener in interface MrcInterface
protected void forwardMessage(AbstractMRListener client,
AbstractMRMessage m)
forwardMessage in class AbstractMRTrafficController
protected void forwardReply(AbstractMRListener client,
AbstractMRReply m)
forwardReply in class AbstractMRTrafficControllerpublic void setSensorManager(SensorManager m)
protected AbstractMRMessage pollMessage()
AbstractMRTrafficController
pollMessage in class AbstractMRTrafficControllerprotected AbstractMRListener pollReplyHandler()
pollReplyHandler in class AbstractMRTrafficController
public void sendMrcMessage(MrcMessage m,
MrcListener reply)
sendMrcMessage in interface MrcInterfaceprotected AbstractMRMessage enterProgMode()
enterProgMode in class AbstractMRTrafficControllerprotected AbstractMRMessage enterNormalMode()
enterNormalMode in class AbstractMRTrafficControllerpublic static MrcTrafficController instance()
protected void setInstance()
setInstance in class AbstractMRTrafficControllerprotected AbstractMRReply newReply()
newReply in class AbstractMRTrafficControllerprotected boolean endOfMessage(AbstractMRReply msg)
endOfMessage in class AbstractMRTrafficController
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||