Package jmri.jmrix.lenz
Class XNetSensor
java.lang.Object
jmri.implementation.AbstractNamedBean
jmri.implementation.AbstractSensor
jmri.jmrix.lenz.XNetSensor
- All Implemented Interfaces:
Comparable<NamedBean>,EventListener,PropertyChangeProvider,DigitalIO,AbstractMRListener,XNetListener,NamedBean,Sensor
Extend jmri.AbstractSensor for XpressNet layouts.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameExceptionNested classes/interfaces inherited from interface jmri.Sensor
Sensor.PullResistance -
Field Summary
FieldsFields inherited from class jmri.implementation.AbstractSensor
_inverted, _knownState, _rawState, r, sensorDebounceGoingActive, sensorDebounceGoingInActive, thr, useDefaultTimerSettingsFields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, registerFields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWNFields inherited from interface jmri.Sensor
ACTIVE, INACTIVE, MAX_DEBOUNCE, PROPERTY_ACTIVE_TIMER, PROPERTY_GLOBAL_TIMER, PROPERTY_INACTIVE_TIMER, PROPERTY_SENSOR_INVERTED -
Constructor Summary
ConstructorsConstructorDescriptionXNetSensor(String systemName, String userName, XNetTrafficController controller, String prefix) XNetSensor(String systemName, XNetTrafficController controller, String prefix) -
Method Summary
Modifier and TypeMethodDescription(package private) intPackage protected routine to get the Sensor Base Address.(package private) intPackage protected routine to get the Sensor Nibble.(package private) intPackage protected routine to get the Sensor Number.(package private) voidinitmessage is a package protected class which allows the Manger to send a feedback message at initialization without changing the state of the sensor with respect to whether or not a feedback request was sent.voidListen for the messages to the LI100/LI101.voidImplementing 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)voidnotifyTimeout(XNetMessage msg) Handle a timeout notification.voidRequest an update on status by sending an XpressNet message.Methods inherited from class jmri.implementation.AbstractSensor
canInvert, describeState, dispose, getBeanType, getInverted, getKnownState, getPullResistance, getRawState, getReporter, getSensorDebounceGoingActiveTimer, getSensorDebounceGoingInActiveTimer, getState, getUseDefaultTimerSettings, sensorDebounce, setInverted, setKnownState, setOwnState, setPullResistance, setReporter, setSensorDebounceGoingActiveTimer, setSensorDebounceGoingInActiveTimer, setState, setUseDefaultTimerSettings, stateChangeCheckMethods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChangeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChangeMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from interface jmri.Sensor
getCommandedState, isConsistentState, setCommandedState
-
Field Details
-
tc
-
-
Constructor Details
-
XNetSensor
public XNetSensor(String systemName, String userName, XNetTrafficController controller, String prefix) -
XNetSensor
-
-
Method Details
-
requestUpdateFromLayout
Request an update on status by sending an XpressNet message.- Specified by:
requestUpdateFromLayoutin interfaceDigitalIO
-
initmessage
initmessage is a package protected class which allows the Manger to send a feedback message at initialization 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- Reply message
-
message
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:
messagein interfaceXNetListener- Parameters:
l- Reply message
-
message
Listen for the messages to the LI100/LI101.- Specified by:
messagein interfaceXNetListener- Parameters:
l- message to process
-
notifyTimeout
Handle a timeout notification.- Specified by:
notifyTimeoutin interfaceXNetListener- Parameters:
msg- The message that timed out
-
getNumber
int getNumber()Package protected routine to get the Sensor Number.- Returns:
- current Sensor address number
-
getBaseAddress
int getBaseAddress()Package protected routine to get the Sensor Base Address.- Returns:
- the Sensor base address
-
getNibble
int getNibble()Package protected routine to get the Sensor Nibble.- Returns:
- contents of sensor nibble
-