Package jmri.jmrix.lenz
Class XNetLight
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractLight
-
- jmri.jmrix.lenz.XNetLight
-
- All Implemented Interfaces:
java.lang.Comparable<NamedBean>
,java.util.EventListener
,PropertyChangeProvider
,DigitalIO
,AbstractMRListener
,XNetListener
,Light
,NamedBean
public class XNetLight extends AbstractLight implements XNetListener
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
Fields Modifier and Type Field Description (package private) static int
COMMANDSENT
(package private) static int
IDLE
(package private) int
mAddress
System dependent instance variables(package private) static int
OFFSENT
Internal State Machine states.-
Fields inherited from class jmri.implementation.AbstractLight
lightControlList, mActive, mCurrentIntensity, mEnabled, mMaxIntensity, mMinIntensity, mState
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
Fields inherited from interface jmri.Light
FAST_CLOCK_CONTROL, INTERMEDIATE, NO_CONTROL, SENSOR_CONTROL, TIMED_ON_CONTROL, TRANSITIONING, TRANSITIONINGHIGHER, TRANSITIONINGLOWER, TRANSITIONINGTOFULLOFF, TRANSITIONINGTOFULLON, TURNOUT_STATUS_CONTROL, TWO_SENSOR_CONTROL
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description XNetLight(XNetTrafficController tc, XNetLightManager lm, java.lang.String systemName)
Create a Light object, with only system name.XNetLight(XNetTrafficController tc, XNetLightManager lm, java.lang.String systemName, java.lang.String userName)
Create a Light object, with both system and user names.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Dispose of the light object.void
message(XNetMessage l)
Listen for the messages to the LI100/LI101.void
message(XNetReply l)
Handle an incoming message from the XpressNet.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
setState(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, setEnabled
-
Methods 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, vetoableChange
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.Light
getCommandedState, getKnownState, isConsistentState, requestUpdateFromLayout, setCommandedState
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChange
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
mAddress
int mAddress
System dependent instance variables
-
OFFSENT
static final int OFFSENT
Internal State Machine states.- See Also:
- Constant Field Values
-
COMMANDSENT
static final int COMMANDSENT
- See Also:
- Constant Field Values
-
IDLE
static final int IDLE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XNetLight
public XNetLight(XNetTrafficController tc, XNetLightManager lm, java.lang.String systemName)
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
public XNetLight(XNetTrafficController tc, XNetLightManager lm, java.lang.String systemName, java.lang.String userName)
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 Detail
-
dispose
public void dispose()
Dispose of the light object.- Specified by:
dispose
in interfaceNamedBean
- Overrides:
dispose
in classAbstractNamedBean
-
setState
public void setState(int newState)
Set the current state of this Light. This routine requests the hardware to change.
-
message
public void message(XNetReply l)
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:
message
in interfaceXNetListener
- Parameters:
l
- the message to handle
-
message
public void message(XNetMessage l)
Listen for the messages to the LI100/LI101.- Specified by:
message
in interfaceXNetListener
- Parameters:
l
- the expected message
-
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 interfaceXNetListener
- Parameters:
msg
- message which has timed out.
-
-