|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractNode
jmri.jmrix.acela.AcelaNode
public class AcelaNode
Models a Acela node.
Nodes are numbered from 0. The first watchman node carries the first 8 sensors 0 to 7, 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.
Same applies to the outputs (Dash-8s and Signalmen)
| Field Summary | |
|---|---|
static byte |
AC
|
static byte |
D8
|
protected int |
endingOutputAddress
|
protected int |
endingSensorAddress
|
protected boolean |
hasActiveSensors
|
protected int |
lastUsedSensor
|
static String[] |
moduleNames
|
protected boolean |
needInit
|
protected int |
nodeType
|
protected byte[] |
outputArray
|
protected int |
outputbitsPerCard
|
static byte |
SC
|
protected Sensor[] |
sensorArray
|
protected int |
sensorbitsPerCard
|
protected boolean[] |
sensorInit
|
protected int[] |
sensorLastSetting
|
protected int[] |
sensorTempSetting
|
static byte |
SM
|
protected int |
startingOutputAddress
|
protected int |
startingSensorAddress
|
static byte |
SW
|
static byte |
SY
|
static byte |
TB
|
protected int |
transmissionDelay
|
static byte |
UN
|
static byte |
WM
|
static byte |
YM
|
| Fields inherited from class jmri.jmrix.AbstractNode |
|---|
nodeAddress |
| Constructor Summary | |
|---|---|
AcelaNode()
Assumes a node address of 0, and a node type of NO_CARD If this constructor is used, actual node address must be set using setNodeAddress, and actual node type using 'setNodeType' |
|
AcelaNode(int address,
int type)
Creates a new AcelaNode and initialize default instance variables address - Address of first bit on Acela bus (0-1023) type - D8, SM, WM |
|
| Method Summary | |
|---|---|
boolean |
checkNodeAddress(int address)
Public method to set the node address. |
AbstractMRMessage |
createInitPacket()
Create an initialization packet if needed |
AbstractMRMessage |
createOutPacket()
Public Method to create an Transmit packet (SerialMessage) |
int |
getEndingOutputAddress()
Public method getting ending output addresss Used to help linear address search |
int |
getEndingSensorAddress()
Public method getting ending sensor addresss Used to help linear address search |
int |
getNodeType()
Public method to return node type |
int |
getNumOutputBitsPerCard()
Public method to return number of bits per card. |
int |
getNumSensorBitsPerCard()
|
boolean |
getOutputBit(int bitNumber)
Public method get the current state of an output bit. |
int |
getSensorBitsPerCard()
Public method to return the number of sensor bits per node. |
int |
getStartingOutputAddress()
Public method getting starting output addresss Used to help linear address search |
int |
getStartingSensorAddress()
Public method getting starting sensor addresss Used to help linear address search |
int |
getTransmissionDelay()
Public method to return transmission delay. |
boolean |
handleTimeout(AbstractMRMessage m)
Deal with a timeout in the transmission controller. |
void |
markChanges(AcelaReply l)
Use the contents of the poll reply to mark changes |
void |
registerSensor(Sensor s,
int rawaddr)
The numbers here are 0 to MAXSENSORBITS, not 1 to MAXSENSORBITS. |
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 |
setEndingOutputAddress(int endingAddress)
Public method setting ending output addresss Used to help linear address search |
void |
setEndingSensorAddress(int endingAddress)
Public method setting ending sensor addresss Used to help linear address search |
void |
setNodeType(int type)
Public method to set node type |
void |
setOutputBit(int bitNumber,
boolean state)
Public method setting an output bit. |
void |
setStartingOutputAddress(int startingAddress)
Public method setting starting output addresss Used to help linear address search |
void |
setStartingSensorAddress(int startingAddress)
Public method setting starting sensor addresss Used to help linear address search |
void |
setTransmissionDelay(int delay)
Public method to set transmission delay. |
| 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 byte AC
public static final byte TB
public static final byte D8
public static final byte WM
public static final byte SM
public static final byte SC
public static final byte SW
public static final byte YM
public static final byte SY
public static final byte UN
public static final String[] moduleNames
protected int nodeType
protected int outputbitsPerCard
protected int sensorbitsPerCard
protected int transmissionDelay
protected boolean needInit
protected byte[] outputArray
protected boolean hasActiveSensors
protected int lastUsedSensor
protected Sensor[] sensorArray
protected boolean[] sensorInit
protected int[] sensorLastSetting
protected int[] sensorTempSetting
protected int startingOutputAddress
protected int endingOutputAddress
protected int startingSensorAddress
protected int endingSensorAddress
| Constructor Detail |
|---|
public AcelaNode()
public AcelaNode(int address,
int type)
| Method Detail |
|---|
public void setStartingOutputAddress(int startingAddress)
public int getStartingOutputAddress()
public void setEndingOutputAddress(int endingAddress)
public int getEndingOutputAddress()
public void setStartingSensorAddress(int startingAddress)
public int getStartingSensorAddress()
public void setEndingSensorAddress(int endingAddress)
public int getEndingSensorAddress()
public void setOutputBit(int bitNumber,
boolean state)
public boolean getOutputBit(int bitNumber)
public boolean sensorsActive()
sensorsActive in class AbstractNodepublic int getNodeType()
public void setNodeType(int type)
public int getNumOutputBitsPerCard()
public int getNumSensorBitsPerCard()
public boolean checkNodeAddress(int address)
checkNodeAddress in class AbstractNodepublic int getSensorBitsPerCard()
public int getTransmissionDelay()
public void setTransmissionDelay(int delay)
public AbstractMRMessage createInitPacket()
createInitPacket in class AbstractNodepublic AbstractMRMessage createOutPacket()
createOutPacket in class AbstractNodepublic void markChanges(AcelaReply l)
l - Reply to a poll operation
public void registerSensor(Sensor s,
int rawaddr)
s - - Sensor objectrawaddr - - 0 to MAXSENSORBITS 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 | |||||||||