Package jmri.jmrix.lenz
Class XNetLight
java.lang.Object
jmri.implementation.AbstractNamedBean
jmri.implementation.AbstractLight
jmri.jmrix.lenz.XNetLight
- All Implemented Interfaces:
Comparable<NamedBean>,EventListener,PropertyChangeProvider,DigitalIO,AbstractMRListener,XNetListener,Light,NamedBean
Implementation of the Light Object for XpressNet.
NOTE: This is a simplification of the XNetTurnout class.
Based in part on SerialLight.java
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) static final int(package private) intSystem dependent instance variables(package private) static final intInternal State Machine states.Fields inherited from class jmri.implementation.AbstractLight
lightControlList, mActive, mCurrentIntensity, mEnabled, mMaxIntensity, mMinIntensity, mStateFields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, registerFields inherited from interface jmri.Light
FAST_CLOCK_CONTROL, INTERMEDIATE, NO_CONTROL, PROPERTY_TARGET_INTENSITY, SENSOR_CONTROL, TIMED_ON_CONTROL, TRANSITIONING, TRANSITIONINGHIGHER, TRANSITIONINGLOWER, TRANSITIONINGTOFULLOFF, TRANSITIONINGTOFULLON, TURNOUT_STATUS_CONTROL, TWO_SENSOR_CONTROLFields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN -
Constructor Summary
ConstructorsConstructorDescriptionXNetLight(XNetTrafficController tc, XNetLightManager lm, String systemName) Create a Light object, with only system name.XNetLight(XNetTrafficController tc, XNetLightManager lm, String systemName, String userName) Create a Light object, with both system and user names. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Dispose of the light object.voidListen for the messages to the LI100/LI101.voidHandle an incoming message from the XpressNet.voidnotifyTimeout(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.voidsetState(int newState) Set the current state of this Light.Methods inherited from class jmri.implementation.AbstractLight
activateLight, addLightControl, clearLightControls, deactivateLight, describeState, doNewState, getBeanType, getEnabled, getLightControlList, getState, getUsageReport, notifyStateChange, notifyTargetIntensityChange, setEnabledMethods 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.Light
getCommandedState, getKnownState, isConsistentState, requestUpdateFromLayout, setCommandedStateMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChangeMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
mAddress
int mAddressSystem dependent instance variables -
OFFSENT
Internal State Machine states.- See Also:
-
COMMANDSENT
- See Also:
-
IDLE
- See Also:
-
-
Constructor Details
-
XNetLight
Create a Light object, with only system name.'systemName' was previously validated in LnLightManager
- Parameters:
tc- the traffic controller for the connectionlm- the managing LightManager for this LightsystemName- the system name for this Light
-
XNetLight
Create a Light object, with both system and user names.'systemName' was previously validated in XNetLightManager
- Parameters:
tc- the traffic controller for the connectionlm- the managing LightManager for this LightsystemName- the system name for this LightuserName- the user name for this Light
-
-
Method Details
-
dispose
Dispose of the light object.- Specified by:
disposein interfaceNamedBean- Overrides:
disposein classAbstractNamedBean
-
setState
Set the current state of this Light. This routine requests the hardware to change. -
message
Handle an incoming message from the XpressNet. NOTE: We aren't registered as a listener, so this is only triggered when we send out a message.- Specified by:
messagein interfaceXNetListener- Parameters:
l- the message to handle
-
message
Listen for the messages to the LI100/LI101.- Specified by:
messagein interfaceXNetListener- Parameters:
l- the expected message
-
notifyTimeout
Description copied from interface:XNetListenerMember function invoked by an XNetInterface implementation to notify a sender that an outgoing message timed out and was dropped from the queue.- Specified by:
notifyTimeoutin interfaceXNetListener- Parameters:
msg- message which has timed out.
-