Package jmri.jmrix.bidib
Class BiDiBLight
java.lang.Object
jmri.implementation.AbstractNamedBean
jmri.implementation.AbstractLight
jmri.implementation.AbstractVariableLight
jmri.jmrix.bidib.BiDiBLight
- All Implemented Interfaces:
Comparable<NamedBean>,AnalogIO,PropertyChangeProvider,DigitalIO,BiDiBNamedBeanInterface,Light,NamedBean,VariableLight
Implementation of the Light Control Object for BiDiB.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.AnalogIO
AnalogIO.AbsoluteOrRelativeNested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
FieldsFields inherited from class jmri.implementation.AbstractVariableLight
alarmSyncUpdate, internalClock, minuteChangeListener, mLastTransitionDate, mNextTransitionTs, mTransitionDuration, mTransitionTargetIntensityFields 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, UNKNOWNFields inherited from interface jmri.VariableLight
PROPERTY_CURRENT_INTENSITY, PROPERTY_MAX_INTENSITY, PROPERTY_MIN_INTENSITY -
Constructor Summary
ConstructorsConstructorDescriptionBiDiBLight(String systemName, BiDiBLightManager mgr) Create a Light object from system name. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Dispose of the light object.voidHelper function that will be invoked after construction once the type has been set.getAddr()Get the BiDiB address instanceGet addres object from a light objectgetMemo()Get connection memo from a light objectprotected intProvide the number of steps available between min and max intensitybooleanCheck if this object can handle variable intensity.booleanCan the Light change its intensity setting slowly?voidnodeLost()called then a node was lostvoidnodeNew()called then a new node has been discoveredvoidreceiveIntensity(int portstat) Transfer incoming change event to JMRIprotected voidsendIntensity(double intensity) Send a Dim/Bright commands to the hardware to reach a specific intensity.protected voidsendLcOutput(int portstat) Send request to traffic controllerprotected voidsendOnOffCommand(int newState) Send a On/Off Command to the hardwarevoidsetState(int newState) Set the current state of this Light.voidsetTargetIntensity(double intensity) Set the intended new intensity value for the Light.Methods inherited from class jmri.implementation.AbstractVariableLight
describeState, getAbsoluteOrRelative, getCommandedAnalogValue, getCurrentIntensity, getMax, getMaxIntensity, getMin, getMinIntensity, getResolution, getState, getTargetIntensity, getTransitionTime, isTransitioning, newInternalMinute, notifyTargetIntensityChange, setCommandedAnalogValue, setMaxIntensity, setMinIntensity, setObservedAnalogValue, setState, setTransitionTime, startTransitionMethods inherited from class jmri.implementation.AbstractLight
activateLight, addLightControl, clearLightControls, deactivateLight, doNewState, getBeanType, getEnabled, getLightControlList, getState, getUsageReport, notifyStateChange, 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.AnalogIO
getKnownAnalogValueMethods inherited from interface jmri.Light
activateLight, addLightControl, clearLightControls, deactivateLight, getCommandedState, getEnabled, getKnownState, getLightControlList, getState, setCommandedState, setEnabledMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, getBeanType, 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.VariableLight
isConsistentState, isConsistentValue, requestUpdateFromLayout
-
Field Details
-
messageHandler
-
-
Constructor Details
-
BiDiBLight
Create a Light object from system name.- Parameters:
systemName- System name of light to be createdmgr- Light Manager, we get the memo object and the type letter (L) from the manager
-
-
Method Details
-
getAddr
Description copied from interface:BiDiBNamedBeanInterfaceGet the BiDiB address instance- Specified by:
getAddrin interfaceBiDiBNamedBeanInterface- Returns:
- BiDiBAddress
-
finishLoad
Helper function that will be invoked after construction once the type has been set. Used specifically for preventing double initialization when loading turnouts from XML.- Specified by:
finishLoadin interfaceBiDiBNamedBeanInterface
-
nodeNew
Description copied from interface:BiDiBNamedBeanInterfacecalled then a new node has been discovered- Specified by:
nodeNewin interfaceBiDiBNamedBeanInterface
-
nodeLost
Description copied from interface:BiDiBNamedBeanInterfacecalled then a node was lost- Specified by:
nodeLostin interfaceBiDiBNamedBeanInterface
-
getMemo
Get connection memo from a light object- Returns:
- BiDiB connection memo instance
-
getAddress
Get addres object from a light object- Returns:
- BiDiB address instance
-
dispose
Dispose of the light object. Remove the Message Listener for this light object- Specified by:
disposein interfaceNamedBean- Overrides:
disposein classAbstractNamedBean
-
isIntensityVariable
Check if this object can handle variable intensity.- Returns:
- true for some LC output types, false for others
-
isTransitionAvailable
Can the Light change its intensity setting slowly?If true, this Light supports a non-zero value of the transitionTime property, which controls how long the Light will take to change from one intensity level to another. BiDiB LIGHTPORTs have internal dimming via port configuration.
Unbound property
- Specified by:
isTransitionAvailablein interfaceVariableLight- Overrides:
isTransitionAvailablein classAbstractVariableLight- Returns:
- true if isIntensityVariable() is true but for a LIGHTPORT return false.
-
setState
Set the current state of this Light. This routine requests the hardware to change. -
setTargetIntensity
Set the intended new intensity value for the Light. If transitions are in use, they will be applied.Bound property between 0 and 1.
A value of 0.0 corresponds to full off, and a value of 1.0 corresponds to full on.
Values at or below the minIntensity property will result in the Light going to the OFF state immediately. Values at or above the maxIntensity property will result in the Light going to the ON state immediately.
- Specified by:
setTargetIntensityin interfaceVariableLight- Overrides:
setTargetIntensityin classAbstractVariableLight- Parameters:
intensity- the desired brightness
-
sendLcOutput
Send request to traffic controller- Parameters:
portstat- BiDiB portstat value (see protocol description for valid values)
-
sendIntensity
Send a Dim/Bright commands to the hardware to reach a specific intensity.- Specified by:
sendIntensityin classAbstractVariableLight- Parameters:
intensity- new intensity
-
receiveIntensity
Transfer incoming change event to JMRI- Parameters:
portstat- BiDiB portstat value (see protocol description for valid values)
-
sendOnOffCommand
Description copied from class:AbstractVariableLightSend a On/Off Command to the hardware- Specified by:
sendOnOffCommandin classAbstractVariableLight- Parameters:
newState- new state
-
getNumberOfSteps
Description copied from class:AbstractVariableLightProvide the number of steps available between min and max intensity- Specified by:
getNumberOfStepsin classAbstractVariableLight- Returns:
- number of steps
-