jmri.jmrix.lenz
Class XNetSensor

Show UML class diagram
java.lang.Object
  extended by jmri.implementation.AbstractNamedBean
      extended by jmri.implementation.AbstractSensor
          extended by jmri.jmrix.lenz.XNetSensor
All Implemented Interfaces:
Serializable, EventListener, AbstractMRListener, XNetListener, NamedBean, Sensor

public class XNetSensor
extends AbstractSensor
implements XNetListener

Extend jmri.AbstractSensor for XPressNet layouts.

See Also:
Serialized Form

Field Summary
(package private) static org.slf4j.Logger log
           
protected  XNetTrafficController tc
           
 
Fields inherited from class jmri.implementation.AbstractSensor
_inverted, _knownState, _rawState, r, sensorDebounceGoingActive, sensorDebounceGoingInActive, thr, useDefaultTimerSettings
 
Fields inherited from class jmri.implementation.AbstractNamedBean
mSystemName, mUserName
 
Fields inherited from interface jmri.Sensor
ACTIVE, INACTIVE
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
XNetSensor(String systemName, String userName, XNetTrafficController controller)
           
XNetSensor(String systemName, XNetTrafficController controller)
           
 
Method Summary
 void dispose()
          Deactivate this object, so that it releases as many resources as possible and no longer effects others.
(package private)  int getBaseAddress()
           
(package private)  int getNibble()
           
(package private)  int getNumber()
           
(package private)  void initmessage(XNetReply l)
          initmessage is a package proteceted class which allows the Manger to send a feedback message at initilization without changing the state of the sensor with respect to whether or not a feedback request was sent.
 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)
          implementing classes will typically have a function/listener to get updates from the layout, which will then call public void firePropertyChange(String propertyName, Object oldValue, Object newValue) _once_ if anything has changed state (or set the commanded state directly)
 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.
 void requestUpdateFromLayout()
          request an update on status by sending an XPressNet message
 
Methods inherited from class jmri.implementation.AbstractSensor
getInverted, getKnownState, getRawState, getReporter, getSensorDebounceGoingActiveTimer, getSensorDebounceGoingInActiveTimer, getState, sensorDebounce, setInverted, setKnownState, setOwnState, setReporter, setSensorDebounceGoingActiveTimer, setSensorDebounceGoingInActiveTimer, setState, useDefaultTimerSettings, useDefaultTimerSettings
 
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removeProperty, removePropertyChangeListener, setComment, setProperty, setUserName, updateListenerRef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.Sensor
addPropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removeProperty, setComment, setProperty, setUserName, updateListenerRef
 

Field Detail

tc

protected XNetTrafficController tc

log

static org.slf4j.Logger log
Constructor Detail

XNetSensor

public XNetSensor(String systemName,
                  String userName,
                  XNetTrafficController controller)

XNetSensor

public XNetSensor(String systemName,
                  XNetTrafficController controller)
Method Detail

requestUpdateFromLayout

public void requestUpdateFromLayout()
request an update on status by sending an XPressNet message

Specified by:
requestUpdateFromLayout in interface Sensor

initmessage

void initmessage(XNetReply l)
initmessage is a package proteceted class which allows the Manger to send a feedback message at initilization without changing the state of the sensor with respect to whether or not a feedback request was sent. This is used only when the sensor is created by on layout feedback.

Parameters:
l -

message

public void message(XNetReply l)
implementing classes will typically have a function/listener to get updates from the layout, which will then call public void firePropertyChange(String propertyName, Object oldValue, Object newValue) _once_ if anything has changed state (or set the commanded state directly)

Specified by:
message in interface XNetListener
Parameters:
l -

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

dispose

public void dispose()
Description copied from interface: NamedBean
Deactivate this object, so that it releases as many resources as possible and no longer effects others.

For example, if this object has listeners, after a call to this method it should no longer notify those listeners. Any native or system-wide resources it maintains should be released, including threads, files, etc.

It is an error to invoke any other methods on this object once dispose() has been called. Note, however, that there is no guarantee about behavior in that case.

Afterwards, references to this object may still exist elsewhere, preventing its garbage collection. But it's formally dead, and shouldn't be keeping any other objects alive. Therefore, this method should null out any references to other objects that this NamedBean contained.

Specified by:
dispose in interface NamedBean
Specified by:
dispose in interface Sensor
Overrides:
dispose in class AbstractNamedBean

getNumber

int getNumber()

getBaseAddress

int getBaseAddress()

getNibble

int getNibble()


Copyright © 1997-2013 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