Package jmri.jmrix.maple
Class SerialNode
java.lang.Object
jmri.jmrix.AbstractNode
jmri.jmrix.maple.SerialNode
Models a serial node, consisting of one Maple Systems HMI touch screen panel.
Nodes are numbered ala the Station number, from 1 to 99.
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
FieldsModifier and TypeFieldDescription(package private) static final intMaximum number of sensors for Maple.(package private) int(package private) booleanFields inherited from class jmri.jmrix.AbstractNode
nodeAddress -
Constructor Summary
ConstructorsConstructorDescriptionSerialNode(int address, int type, SerialTrafficController tc) Create a new SerialNode and initialize default instance variables.Assumes a node address of 1, and a node type of 0. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckNodeAddress(int address) Check valid node address, must match value configured in the Maple HMI.Create an Initialization packet (SerialMessage) for this node.Create a Transmit packet (SerialMessage).intGet this node's address.booleanGet state of Sensors.intbooleanDeal with a timeout in the transmission controller.voidA reply was received, so there was no timeout, do any needed processing.(package private) voidMethods inherited from class jmri.jmrix.AbstractNode
getNodeAddress, mustSend, resetMustSend, setMustSend, setNodeAddress
-
Field Details
-
Constructor Details
-
SerialNode
Assumes a node address of 1, and a node type of 0. If this constructor is used, actual node address must be set using setNodeAddress.- Parameters:
tc- serial traffic controller.
-
SerialNode
Create a new SerialNode and initialize default instance variables.- Parameters:
address- Address of node on serial bus (0-99)type- 0 (ignored)tc- system traffic controller.
-
-
Method Details
-
getSensorsActive
Get state of Sensors.- Specified by:
getSensorsActivein classAbstractNode- Returns:
- 'true' since at least one sensor is defined
-
checkNodeAddress
Check valid node address, must match value configured in the Maple HMI.- Specified by:
checkNodeAddressin classAbstractNode- Parameters:
address- node ID, allowed values are 1-99- Returns:
- true if in valid range
-
getAddress
Get this node's address.- Returns:
- node address.
-
createInitPacket
Create an Initialization packet (SerialMessage) for this node.Note: Maple Systems devices do not need initialization. This is here for completion.
- Specified by:
createInitPacketin classAbstractNode- Returns:
- the packet, or 'null' if not needed
-
createOutPacket
Create a Transmit packet (SerialMessage). Not used in Maple.- Specified by:
createOutPacketin classAbstractNode- Returns:
- packet to send current node state.
-
warn
-
handleTimeout
Deal with a timeout in the transmission controller.- Specified by:
handleTimeoutin classAbstractNode- Parameters:
m- message that didn't receive a replyl- listener that sent the message- Returns:
- true if initialization required
-
resetTimeout
Description copied from class:AbstractNodeA reply was received, so there was no timeout, do any needed processing.- Specified by:
resetTimeoutin classAbstractNode- Parameters:
m- message received that has reset the timeout and is waiting to be handled
-
getTimeoutCount
-