Package jmri.jmrix.dccpp
Class DCCppLight
java.lang.Object
jmri.implementation.AbstractNamedBean
jmri.implementation.AbstractLight
jmri.jmrix.dccpp.DCCppLight
- All Implemented Interfaces:
Comparable<NamedBean>,EventListener,PropertyChangeProvider,DigitalIO,AbstractMRListener,DCCppListener,Light,NamedBean
Implementation of the Light Object for DCC++
NOTE: This is a simplification of the DCCppTurnout 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 intFields 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
ConstructorsConstructorDescriptionDCCppLight(DCCppTrafficController tc, DCCppLightManager lm, String systemName) Create a Light object, with only system name.DCCppLight(DCCppTrafficController tc, DCCppLightManager 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.voidMember function that will be invoked by a DCCppInterface implementation to forward a DCC++ message sent to the layout.voidMember function that will be invoked by a DCCppInterface implementation to forward a DCC++ message from the layout.voidMember function invoked by an DCCppInterface 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
- See Also:
-
COMMANDSENT
- See Also:
-
IDLE
- See Also:
-
-
Constructor Details
-
DCCppLight
Create a Light object, with only system name.'systemName' was previously validated in DCCppLightManager
- Parameters:
tc- the traffic controller for the connectionlm- the managing LightManager for this LightsystemName- the system name for this Light
-
DCCppLight
public DCCppLight(DCCppTrafficController tc, DCCppLightManager lm, String systemName, String userName) Create a Light object, with both system and user names.'systemName' was previously validated in DCCppLightManager
- 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
Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message from the layout. Handle an incoming message from the DCC++ Base Station.NOTE: We aren't registered as a listener, so this is only triggered when we send out a message
- Specified by:
messagein interfaceDCCppListener- Parameters:
l- The received DCC++ message. Note that this same object may be presented to multiple users. It should not be modified here.
-
message
Member function that will be invoked by a DCCppInterface implementation to forward a DCC++ message sent to the layout. Normally, this function will do nothing. Listen for messages to the DCC++ Base Station.- Specified by:
messagein interfaceDCCppListener- Parameters:
l- The received DCC++ message. Note that this same object may be presented to multiple users. It should not be modified here.
-
notifyTimeout
Description copied from interface:DCCppListenerMember function invoked by an DCCppInterface implementation to notify a sender that an outgoing message timed out and was dropped from the queue.- Specified by:
notifyTimeoutin interfaceDCCppListener- Parameters:
msg- the message that timed out.
-