jmri.jmrix.lenz
Class XNetSensorManager

java.lang.Object
  extended by jmri.managers.AbstractManager
      extended by jmri.managers.AbstractSensorManager
          extended by jmri.jmrix.lenz.XNetSensorManager
All Implemented Interfaces:
PropertyChangeListener, EventListener, AbstractMRListener, XNetListener, Manager, SensorManager

public class XNetSensorManager
extends AbstractSensorManager
implements XNetListener

Manage the XPressNet specific Sensor implementation. System names are "XSnnn", where nnn is the sensor number without padding.

Author:
Paul Bender Copyright (C) 2003-2010

Field Summary
protected  String prefix
           
protected  XNetTrafficController tc
           
 
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
XNetSensorManager(XNetTrafficController controller, String prefix)
           
 
Method Summary
 boolean allowMultipleAdditions(String systemName)
          A method that determines if it is possible to add a range of sensors in numerical order eg 10 to 30, primarily used to enable/disable the add range box in the add sensor panel
 Sensor createNewSensor(String systemName, String userName)
          Internal method to invoke the factory, after all the logic for returning an existing method has been invoked.
 String createSystemName(String curAddress, String prefix)
           
 void dispose()
          Free resources when no longer used.
 String getNextValidAddress(String curAddress, String prefix)
          Does not enforce any rules on the encoder or input values.
 String getSystemPrefix()
          Provides access to the system prefix string.
static XNetSensorManager instance()
          Deprecated. 
 void message(XNetMessage l)
          Member function that will be invoked by a XNetInterface implementation to forward a XNet message sent to the layout.
 void message(XNetReply l)
          Member function that will be invoked by a XNetInterface implementation to forward a XNet message from the layout.
 void notifyTimeout(XNetMessage msg)
          Member function invoked by an XNetInterface implementation to notify * a sender that an outgoing message timed out and was dropped from the * queue.
 
Methods inherited from class jmri.managers.AbstractSensorManager
getBySystemName, getByUserName, getDefaultSensorDebounceGoingActive, getDefaultSensorDebounceGoingInActive, getInstanceBySystemName, getSensor, getXMLOrder, newSensor, normalizeSystemName, provideSensor, setDefaultSensorDebounceGoingActive, setDefaultSensorDebounceGoingInActive, typeLetter, updateAll
 
Methods inherited from class jmri.managers.AbstractManager
addPropertyChangeListener, deregister, 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
getSystemNameList
 
Methods inherited from interface jmri.Manager
addPropertyChangeListener, deregister, getBeanBySystemName, getSystemNameArray, makeSystemName, register, removePropertyChangeListener, systemLetter
 

Field Detail

prefix

protected String prefix

tc

protected XNetTrafficController tc
Constructor Detail

XNetSensorManager

public XNetSensorManager(XNetTrafficController controller,
                         String prefix)
Method Detail

getSystemPrefix

public String getSystemPrefix()
Description copied from interface: Manager
Provides access to the system prefix string. This was previously called the "System letter"

Specified by:
getSystemPrefix in interface Manager

instance

@Deprecated
public static XNetSensorManager instance()
Deprecated. 


dispose

public void dispose()
Description copied from interface: Manager
Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.

Specified by:
dispose in interface Manager
Specified by:
dispose in interface SensorManager
Overrides:
dispose in class AbstractManager

createNewSensor

public Sensor createNewSensor(String systemName,
                              String userName)
Description copied from class: AbstractSensorManager
Internal method to invoke the factory, after all the logic for returning an existing method has been invoked.

Specified by:
createNewSensor in class AbstractSensorManager
Returns:
new null

message

public void message(XNetReply l)
Description copied from interface: XNetListener
Member function that will be invoked by a XNetInterface implementation to forward a XNet message from the layout.

Specified by:
message in interface XNetListener
Parameters:
l - The received XNet message. Note that this same object may be presented to multiple users. It should not be modified here.

message

public void message(XNetMessage l)
Description copied from interface: XNetListener
Member function that will be invoked by a XNetInterface implementation to forward a XNet message sent to the layout. Normally, this function will do nothing.

Specified by:
message in interface XNetListener
Parameters:
l - The received XNet message. Note that this same object may be presented to multiple users. It should not be modified here.

notifyTimeout

public void notifyTimeout(XNetMessage msg)
Description copied from interface: XNetListener
Member function invoked by an XNetInterface implementation to notify * a sender that an outgoing message timed out and was dropped from the * queue.

Specified by:
notifyTimeout in interface XNetListener

allowMultipleAdditions

public boolean allowMultipleAdditions(String systemName)
Description copied from class: AbstractSensorManager
A method that determines if it is possible to add a range of sensors in numerical order eg 10 to 30, primarily used to enable/disable the add range box in the add sensor panel

Specified by:
allowMultipleAdditions in interface SensorManager
Overrides:
allowMultipleAdditions in class AbstractSensorManager

createSystemName

public String createSystemName(String curAddress,
                               String prefix)
                        throws JmriException
Specified by:
createSystemName in interface SensorManager
Overrides:
createSystemName in class AbstractSensorManager
Throws:
JmriException

getNextValidAddress

public String getNextValidAddress(String curAddress,
                                  String prefix)
Does not enforce any rules on the encoder or input values.

Specified by:
getNextValidAddress in interface SensorManager
Overrides:
getNextValidAddress in class AbstractSensorManager
Parameters:
curAddress - - The hardware address of the turnout we which to check.
prefix - - The System Prefix used to make up the systemName


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