jmri.jmrix.maple
Class SerialNode

java.lang.Object
  extended by jmri.jmrix.AbstractNode
      extended by jmri.jmrix.maple.SerialNode

public class SerialNode
extends AbstractNode

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.

Author:
Bob Jacobsen Copyright (C) 2003, 2008, Bob Jacobsen, Dave Duchamp, multiNode extensions, 2004, Bob Jacobsen, Dave Duchamp, revised for Maple, 2009

Field Summary
 
Fields inherited from class jmri.jmrix.AbstractNode
nodeAddress
 
Constructor Summary
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.
SerialNode(int address, int type)
          Creates a new SerialNode and initialize default instance variables address - Address of node on serial bus (0-99) type - 0 (ignored).
 
Method Summary
protected  boolean checkNodeAddress(int address)
          Check valid node address, must match value configured in the Maple HMI Allowed values are 1-99
 AbstractMRMessage createInitPacket()
          Public Method to create an Initialization packet (SerialMessage) for this node Note: Maple Systems devices do not need initialization.
 AbstractMRMessage createOutPacket()
          Public Method to create an Transmit packet (SerialMessage) Not used in Maple.
 int getAddress()
          Public access to this node's address
 boolean getSensorsActive()
          Public method to return state of Sensors.
 int getTimeoutCount()
           
 boolean handleTimeout(AbstractMRMessage m, AbstractMRListener l)
          Deal with a timeout in the transmission controller.
 void resetTimeout(AbstractMRMessage m)
          A reply was received, so there was not timeout, do any needed processing.
 
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
 

Constructor Detail

SerialNode

public 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.


SerialNode

public SerialNode(int address,
                  int type)
Creates a new SerialNode and initialize default instance variables address - Address of node on serial bus (0-99) type - 0 (ignored).

Method Detail

getSensorsActive

public boolean getSensorsActive()
Public method to return state of Sensors. Note: returns 'true' since at least one sensor is defined

Specified by:
getSensorsActive in class AbstractNode

checkNodeAddress

protected boolean checkNodeAddress(int address)
Check valid node address, must match value configured in the Maple HMI Allowed values are 1-99

Specified by:
checkNodeAddress in class AbstractNode
Returns:
true if valid

getAddress

public int getAddress()
Public access to this node's address


createInitPacket

public AbstractMRMessage createInitPacket()
Public Method to create an Initialization packet (SerialMessage) for this node Note: Maple Systems devices do not need initialization. This is here for completion.

Specified by:
createInitPacket in class AbstractNode

createOutPacket

public AbstractMRMessage createOutPacket()
Public Method to create an Transmit packet (SerialMessage) Not used in Maple.

Specified by:
createOutPacket in class AbstractNode

handleTimeout

public boolean handleTimeout(AbstractMRMessage m,
                             AbstractMRListener l)
Description copied from class: AbstractNode
Deal with a timeout in the transmission controller.

Specified by:
handleTimeout in class AbstractNode
Parameters:
m - message that didn't receive a reply
l - listener that sent the message
Returns:
true if initialization required

resetTimeout

public void resetTimeout(AbstractMRMessage m)
Description copied from class: AbstractNode
A reply was received, so there was not timeout, do any needed processing.

Specified by:
resetTimeout in class AbstractNode

getTimeoutCount

public int getTimeoutCount()


Copyright © 1997 - 2011 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: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads