|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractNode
jmri.jmrix.secsi.SerialNode
public class SerialNode
Models a serial node.
Nodes are numbered ala their address, from 0 to 255. Node number 1 carries sensors 1 to 999, node 2 1001 to 1999 etc.
The array of sensor states is used to update sensor known state only when there's a change on the serial bus. This allows for the sensor state to be updated within the program, keeping this updated state until the next change on the serial bus. E.g. you can manually change a state via an icon, and not have it change back the next time that node is polled.
| Field Summary | |
|---|---|
static String[] |
boardNames
|
static int |
CABDRIVER
|
static int |
DAUGHTER
|
protected boolean |
hasActiveSensors
|
static int[] |
inputBits
|
protected int |
lastUsedSensor
|
protected int |
nodeType
|
protected boolean[] |
outputArray
|
protected boolean[] |
outputBitChanged
|
static int[] |
outputBits
|
protected Sensor[] |
sensorArray
|
protected int[] |
sensorLastSetting
|
protected int[] |
sensorTempSetting
|
| Fields inherited from class jmri.jmrix.AbstractNode |
|---|
nodeAddress |
| Constructor Summary | |
|---|---|
SerialNode()
Assumes a node address of 0, and a node type of 0 (IO24) If this constructor is used, actual node address must be set using setNodeAddress, and actual node type using 'setNodeType' |
|
SerialNode(int address,
int type)
Creates a new SerialNode and initialize default instance variables address - Address of node on serial bus (0-255) type - a type constant from the class |
|
| Method Summary | |
|---|---|
protected boolean |
checkNodeAddress(int address)
Check for valid node address |
AbstractMRMessage |
createInitPacket()
Public Method to create an Initialization packet (SerialMessage) for this node. |
AbstractMRMessage |
createOutPacket()
Public Method to create an Transmit packet (SerialMessage) |
int |
getNodeType()
Public method to return node type Current types are: SMINI, USIC_SUSIC, |
boolean |
handleTimeout(AbstractMRMessage m)
Deal with a timeout in the transmission controller. |
void |
markChanges(SerialReply l)
Use the contents of the poll reply to mark changes |
void |
registerSensor(Sensor s,
int i)
The numbers here are 0 to MAXSENSORS, not 1 to MAXSENSORS. |
void |
resetTimeout(AbstractMRMessage m)
A reply was received, so there was not timeout, do any needed processing. |
boolean |
sensorsActive()
Public method to return state of Sensors. |
void |
setNodeType(int type)
Public method to set node type. |
void |
setOutputBit(int bitNumber,
boolean state)
Public method setting an output bit. |
| Methods inherited from class jmri.jmrix.AbstractNode |
|---|
getNodeAddress, mustSend, resetMustSend, setMustSend, setNodeAddress |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DAUGHTER
public static final int CABDRIVER
public static final String[] boardNames
public static final int[] outputBits
public static final int[] inputBits
protected int nodeType
protected boolean[] outputArray
protected boolean[] outputBitChanged
protected boolean hasActiveSensors
protected int lastUsedSensor
protected Sensor[] sensorArray
protected int[] sensorLastSetting
protected int[] sensorTempSetting
| Constructor Detail |
|---|
public SerialNode()
public SerialNode(int address,
int type)
| Method Detail |
|---|
public void setOutputBit(int bitNumber,
boolean state)
public boolean sensorsActive()
sensorsActive in class AbstractNodepublic int getNodeType()
public void setNodeType(int type)
protected boolean checkNodeAddress(int address)
checkNodeAddress in class AbstractNodepublic AbstractMRMessage createInitPacket()
createInitPacket in class AbstractNodepublic AbstractMRMessage createOutPacket()
createOutPacket in class AbstractNodepublic void markChanges(SerialReply l)
l - Reply to a poll operation
public void registerSensor(Sensor s,
int i)
s - - Sensor objecti - - 0 to MAXSENSORS number of sensor's input bit on this nodepublic boolean handleTimeout(AbstractMRMessage m)
AbstractNode
handleTimeout in class AbstractNodem - message that didn't receive a reply
public void resetTimeout(AbstractMRMessage m)
AbstractNode
resetTimeout in class AbstractNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||