jmri.jmrix.acela
Class AcelaSensorManager

java.lang.Object
  extended by jmri.managers.AbstractManager
      extended by jmri.managers.AbstractSensorManager
          extended by jmri.jmrix.acela.AcelaSensorManager
All Implemented Interfaces:
PropertyChangeListener, EventListener, AbstractMRListener, AcelaListener, Manager, SensorManager

public class AcelaSensorManager
extends AbstractSensorManager
implements AcelaListener

Manage the Acela-specific Sensor implementation.

System names are "ASnnnn", where nnnn is the sensor number without padding.

Sensors are numbered from 0.

This is a AcelaListener to handle the replies to poll messages. Those are forwarded to the specific AcelaNode object corresponding to their origin for processing of the data.

Author:
Bob Jacobsen Copyright (C) 2003, 2007, Dave Duchamp, multi node extensions, 2004, Bob Coleman Copyright (C) 2007, 2008 Based on CMRI serial example, modified to establish Acela support.

Field Summary
 
Fields inherited from class jmri.managers.AbstractSensorManager
sensorDebounceGoingActive, sensorDebounceGoingInActive
 
Fields inherited from class jmri.managers.AbstractManager
_tsys, _tuser
 
Fields inherited from interface jmri.Manager
AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXS, MEMORIES, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS
 
Constructor Summary
AcelaSensorManager()
           
 
Method Summary
 boolean allowMultipleAdditions()
           
 Sensor createNewSensor(String systemName, String userName)
          Create a new sensor if all checks are passed System name is normalized to ensure uniqueness.
 String getSystemPrefix()
          Return the Acela system letter
static AcelaSensorManager instance()
          static function returning the AcelaSensorManager instance to use.
 void message(AcelaMessage r)
          Dummy routine
 void registerSensorsForNode(AcelaNode node)
          Method to register any orphan Sensors when a new Acela Node is created
 void reply(AcelaReply r)
          Process a reply to a poll of Sensors of one node
 
Methods inherited from class jmri.managers.AbstractSensorManager
allowMultipleAdditions, createSystemName, getBySystemName, getByUserName, getDefaultSensorDebounceGoingActive, getDefaultSensorDebounceGoingInActive, getInstanceBySystemName, getNextValidAddress, getSensor, getXMLOrder, newSensor, normalizeSystemName, provideSensor, setDefaultSensorDebounceGoingActive, setDefaultSensorDebounceGoingInActive, typeLetter, updateAll
 
Methods inherited from class jmri.managers.AbstractManager
addPropertyChangeListener, deregister, dispose, firePropertyChange, getBeanBySystemName, getInstanceByUserName, getSystemNameArray, getSystemNameList, makeSystemName, propertyChange, register, registerSelf, removePropertyChangeListener, systemLetter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.SensorManager
dispose, getSystemNameList
 
Methods inherited from interface jmri.Manager
addPropertyChangeListener, deregister, getBeanBySystemName, getSystemNameArray, makeSystemName, register, removePropertyChangeListener, systemLetter
 

Constructor Detail

AcelaSensorManager

public AcelaSensorManager()
Method Detail

getSystemPrefix

public String getSystemPrefix()
Return the Acela system letter

Specified by:
getSystemPrefix in interface Manager

createNewSensor

public Sensor createNewSensor(String systemName,
                              String userName)
Create a new sensor if all checks are passed System name is normalized to ensure uniqueness.

Specified by:
createNewSensor in class AbstractSensorManager
Returns:
new null

message

public void message(AcelaMessage r)
Dummy routine

Specified by:
message in interface AcelaListener

reply

public void reply(AcelaReply r)
Process a reply to a poll of Sensors of one node

Specified by:
reply in interface AcelaListener

registerSensorsForNode

public void registerSensorsForNode(AcelaNode node)
Method to register any orphan Sensors when a new Acela Node is created


allowMultipleAdditions

public boolean allowMultipleAdditions()

instance

public static AcelaSensorManager instance()
static function returning the AcelaSensorManager instance to use.

Returns:
The registered AcelaSensorManager instance for general use, if need be creating one.


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