|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractNode
jmri.jmrix.oaktree.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 | |
|---|---|
protected boolean |
hasActiveSensors
|
static int |
IO24
|
static int |
IO48
|
protected int |
lastUsedSensor
|
protected int |
nodeType
|
static int |
O48
|
protected byte[] |
outputArray
|
protected boolean[] |
outputByteChanged
|
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) |
static String[] |
getBoardNames()
|
int |
getNodeType()
Public method to return node type Current types are: SMINI, USIC_SUSIC, |
boolean |
getSensorsActive()
Public method to return state of Sensors. |
boolean |
handleTimeout(AbstractMRMessage m,
AbstractMRListener l)
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 |
resetMustSend()
Public to reset state of needSend flag. |
void |
resetTimeout(AbstractMRMessage m)
A reply was received, so there was not timeout, do any needed processing. |
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, 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 IO24
public static final int IO48
public static final int O48
protected int nodeType
protected byte[] outputArray
protected boolean[] outputByteChanged
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 static String[] getBoardNames()
public void setOutputBit(int bitNumber,
boolean state)
public boolean getSensorsActive()
getSensorsActive in class AbstractNodepublic void resetMustSend()
resetMustSend 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 node
public boolean handleTimeout(AbstractMRMessage m,
AbstractMRListener l)
AbstractNode
handleTimeout in class AbstractNodem - message that didn't receive a replyl - listener that sent the message
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 | |||||||||