Package jmri.jmrix.can.cbus
Class CbusLight
- java.lang.Object
- 
- jmri.implementation.AbstractNamedBean
- 
- jmri.implementation.AbstractLight
- 
- jmri.jmrix.can.cbus.CbusLight
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Comparable<NamedBean>,- java.util.EventListener,- PropertyChangeProvider,- DigitalIO,- AbstractMRListener,- CanListener,- CbusEventInterface,- Light,- NamedBean
 
 public class CbusLight extends AbstractLight implements CanListener, CbusEventInterface Light implementation for CBUS connections.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface jmri.NamedBeanNamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
 
- 
 - 
Field Summary- 
Fields inherited from class jmri.implementation.AbstractLightlightControlList, mActive, mCurrentIntensity, mEnabled, mMaxIntensity, mMinIntensity, mState
 - 
Fields inherited from class jmri.implementation.AbstractNamedBeanlistenerRefs, mSystemName, register
 - 
Fields inherited from interface jmri.LightFAST_CLOCK_CONTROL, INTERMEDIATE, NO_CONTROL, PROPERTY_TARGET_INTENSITY, SENSOR_CONTROL, TIMED_ON_CONTROL, TRANSITIONING, TRANSITIONINGHIGHER, TRANSITIONINGLOWER, TRANSITIONINGTOFULLOFF, TRANSITIONINGTOFULLON, TURNOUT_STATUS_CONTROL, TWO_SENSOR_CONTROL
 - 
Fields inherited from interface jmri.NamedBeanDISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedCbusLight(java.lang.String prefix, java.lang.String address, TrafficController tc)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Deactivate this object, so that it releases as many resources as possible and no longer effects others.protected voiddoNewState(int oldState, int newState)Handle a request to change state by sending CBUS events.CanMessagegetAddrOff()Get a CanMessage for the Off Light Address.CanMessagegetAddrOn()Get a CanMessage for the On Light Address.CanMessagegetBeanOffMessage()Get event for primary Bean Off Action.CanMessagegetBeanOnMessage()Get event for primary Bean On Action.voidmessage(CanMessage f)Called when an outgoing message is sent to the CAN Network.voidreply(CanReply origf)Called when an incoming CanFrame is received from the CAN Network.voidrequestUpdateFromLayout()Request an update from the layout soft/hardware.- 
Methods inherited from class jmri.implementation.AbstractLightactivateLight, addLightControl, clearLightControls, deactivateLight, describeState, getBeanType, getEnabled, getLightControlList, getState, getUsageReport, notifyStateChange, notifyTargetIntensityChange, setEnabled, setState
 - 
Methods inherited from class jmri.implementation.AbstractNamedBeanaddPropertyChangeListener, 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.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface jmri.jmrix.can.CanListeneraddTc, addTc, removeTc, removeTc
 - 
Methods inherited from interface jmri.jmrix.can.cbus.CbusEventInterfacecheckEvent
 - 
Methods inherited from interface jmri.LightgetCommandedState, getKnownState, isConsistentState, setCommandedState
 - 
Methods inherited from interface jmri.NamedBeanaddPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChange
 - 
Methods inherited from interface jmri.beans.PropertyChangeProvideraddPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 
- 
 
- 
- 
- 
Constructor Detail- 
CbusLightprotected CbusLight(java.lang.String prefix, java.lang.String address, TrafficController tc) 
 
- 
 - 
Method Detail- 
doNewStateprotected void doNewState(int oldState, int newState) Handle a request to change state by sending CBUS events.- Overrides:
- doNewStatein class- AbstractLight
- Parameters:
- oldState- old state
- newState- new state
 
 - 
requestUpdateFromLayoutpublic void requestUpdateFromLayout() Request an update from the layout soft/hardware. May not even happen, and if it does it will happen later; listen for the result.- Specified by:
- requestUpdateFromLayoutin interface- DigitalIO
- Specified by:
- requestUpdateFromLayoutin interface- Light
 
 - 
messagepublic void message(CanMessage f) Called when an outgoing message is sent to the CAN Network.- Specified by:
- messagein interface- CanListener
- Parameters:
- f- the CanMessage being sent.
 
 - 
replypublic void reply(CanReply origf) Called when an incoming CanFrame is received from the CAN Network.- Specified by:
- replyin interface- CanListener
- Parameters:
- origf- the CanReply being received.
 
 - 
getAddrOnpublic CanMessage getAddrOn() Get a CanMessage for the On Light Address.- Returns:
- CanMessage for Light ON
 
 - 
getAddrOffpublic CanMessage getAddrOff() Get a CanMessage for the Off Light Address.- Returns:
- CanMessage for Light OFF
 
 - 
getBeanOnMessagepublic CanMessage getBeanOnMessage() Get event for primary Bean On Action. e.g. without inversion, Light On.- Specified by:
- getBeanOnMessagein interface- CbusEventInterface
- Returns:
- Event for the Action, may be null
 
 - 
getBeanOffMessagepublic CanMessage getBeanOffMessage() Get event for primary Bean Off Action. e.g. without Inversion Light Off.- Specified by:
- getBeanOffMessagein interface- CbusEventInterface
- Returns:
- Event for the Action, may be null
 
 - 
disposepublic void dispose() 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:
- disposein interface- NamedBean
- Overrides:
- disposein class- AbstractNamedBean
 
 
- 
 
-