jmri.jmrix
Class AbstractMRNodeTrafficController

java.lang.Object
  extended by jmri.jmrix.AbstractMRTrafficController
      extended by jmri.jmrix.AbstractMRNodeTrafficController
Direct Known Subclasses:
AcelaTrafficController, SerialTrafficController, SerialTrafficController, SerialTrafficController, SerialTrafficController

public abstract class AbstractMRNodeTrafficController
extends AbstractMRTrafficController

Abstract Traffic Controller base class for those implementations that track a set of nodes.

The nodes are descendents of AbstractNode. Provides node management services, but no additional protocol.

Author:
jake Copyright 2008

Nested Class Summary
 
Nested classes/interfaces inherited from class jmri.jmrix.AbstractMRTrafficController
AbstractMRTrafficController.RcvNotifier, AbstractMRTrafficController.XmtNotifier
 
Field Summary
protected  int maxNode
           
protected  int minNode
           
 
Fields inherited from class jmri.jmrix.AbstractMRTrafficController
allowUnexpectedReply, cmdListeners, controller, IDLESTATE, istream, mCurrentMode, mCurrentState, mLastSender, mWaitBeforePoll, NORMALMODE, NOTIFIEDSTATE, OKSENDMSGSTATE, ostream, PROGRAMINGMODE, replyInDispatch, WAITMSGREPLYSTATE, WAITREPLYINNORMMODESTATE, WAITREPLYINPROGMODESTATE, xmtRunnable
 
Constructor Summary
AbstractMRNodeTrafficController()
          Creates a new instance of AbstractMRNodeTrafficController
 
Method Summary
 void deleteNode(int nodeAddress)
          Public method to delete a Serial node by node address
protected  boolean getMustInit(int i)
          Does this node need to have initialization data sent?
 AbstractNode getNode(int index)
          Public method to return the Serial node with a given index Note: To cycle through all nodes, begin with index=0, and increment your index at each call.
 AbstractNode getNodeFromAddress(int addr)
          Public method to identify a SerialNode from its node address Note: 'addr' is the node address, numbered from 0.
 int getNumNodes()
          Get the number of currently registered nodes
protected  void init(int minNode, int maxNode)
          Initialize based on number of first and last nodes
 void registerNode(AbstractNode node)
          Public method to register a Serial node
protected  void setMustInit(AbstractNode node, boolean v)
           
protected  void setMustInit(int i, boolean v)
          Mark whether this node needs to have initialization data sent
 
Methods inherited from class jmri.jmrix.AbstractMRTrafficController
addHeaderToOutput, addListener, addTrailerToOutput, canReceive, connectionWarn, connectPort, disconnectPort, endOfMessage, enterNormalMode, enterProgMode, enterProgModeDelayTime, finalize, forwardMessage, forwardReply, forwardToPort, getPortName, handleOneIncomingReply, handleTimeout, hasTimeouts, lengthOfByteStream, loadChars, newRcvNotifier, newReply, notifyMessage, notifyReply, pollMessage, pollReplyHandler, portReadyToSend, portWarn, programmerIdle, readByteProtected, receiveLoop, removeListener, reportReceiveLoopException, resetTimeout, sendMessage, setAllowUnexpectedReply, setInstance, status, waitForStartOfReply
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minNode

protected int minNode

maxNode

protected int maxNode
Constructor Detail

AbstractMRNodeTrafficController

public AbstractMRNodeTrafficController()
Creates a new instance of AbstractMRNodeTrafficController

Method Detail

init

protected void init(int minNode,
                    int maxNode)
Initialize based on number of first and last nodes


getMustInit

protected boolean getMustInit(int i)
Does this node need to have initialization data sent?


setMustInit

protected void setMustInit(int i,
                           boolean v)
Mark whether this node needs to have initialization data sent


setMustInit

protected void setMustInit(AbstractNode node,
                           boolean v)

getNumNodes

public int getNumNodes()
Get the number of currently registered nodes


registerNode

public void registerNode(AbstractNode node)
Public method to register a Serial node


getNode

public AbstractNode getNode(int index)
Public method to return the Serial node with a given index Note: To cycle through all nodes, begin with index=0, and increment your index at each call. When index exceeds the number of defined nodes, this routine returns 'null'.


getNodeFromAddress

public AbstractNode getNodeFromAddress(int addr)
Public method to identify a SerialNode from its node address Note: 'addr' is the node address, numbered from 0. Returns 'null' if a SerialNode with the specified address was not found


deleteNode

public void deleteNode(int nodeAddress)
Public method to delete a Serial node by node address



Copyright © 1997 - 2008 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: SourceForge_Logo