jmri.jmrix.powerline
Class SerialLight

java.lang.Object
  extended by jmri.AbstractNamedBean
      extended by jmri.AbstractLight
          extended by jmri.AbstractVariableLight
              extended by jmri.jmrix.powerline.SerialLight
All Implemented Interfaces:
Serializable, Light, NamedBean
Direct Known Subclasses:
SpecificLight, SpecificLight

public abstract class SerialLight
extends AbstractVariableLight

Implementation of the Light Object for X10.

Uses X10 dimming commands to set intensity unless the value is 0.0 or 1.0, in which case it uses on/off commands only.

Since the dim/bright step of the hardware is unknown then the Light object is first created, the first time the intensity (not state) is set to other than 0.0 or 1.0, the output is run to it's maximum dim or bright step so that we know the count is right.

Keeps track of the controller's "dim count", and if not certain forces it to zero to be sure.

Author:
Dave Duchamp Copyright (C) 2004, Bob Jacobsen Copyright (C) 2006, 2007, 2008
See Also:
Serialized Form

Field Summary
protected  int devicecode
           
protected  int housecode
           
 
Fields inherited from class jmri.AbstractVariableLight
alarmSyncUpdate, internalClock, minuteChangeListener, mLastTransitionDate, mNextTransitionTs, mTransitionDuration, mTransitionTargetIntensity
 
Fields inherited from class jmri.AbstractLight
mActive, mClock, mControlSensor, mControlSensorName, mControlSensorSense, mControlTurnout, mControlTurnoutName, mControlType, mCurrentIntensity, mEnabled, mFastClockOffHour, mFastClockOffMin, mFastClockOnHour, mFastClockOnMin, mLightOnTimerActive, mMaxIntensity, mMinIntensity, mSensorListener, mState, mTimebaseListener, mTimedActive, mTimedControlListener, mTimedControlSensor, mTimedControlTimer, mTimedSensorListener, mTimedSensorName, mTimeOff, mTimeOn, mTimeOnDuration, mTurnoutListener, mTurnoutState
 
Fields inherited from interface jmri.Light
FAST_CLOCK_CONTROL, INTERMEDIATE, NO_CONTROL, OFF, ON, SENSOR_CONTROL, TIMED_ON_CONTROL, TRANSITIONING, TRANSITIONINGHIGHER, TRANSITIONINGLOWER, TRANSITIONINGTOFULLOFF, TRANSITIONINGTOFULLON, TURNOUT_STATUS_CONTROL
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
SerialLight(String systemName)
          Create a Light object, with only system name.
SerialLight(String systemName, String userName)
          Create a Light object, with both system and user names.
 
Method Summary
protected  void initializeLight()
          Invoked from constructors to set up details.
protected  void initIntensity(double intensity)
          Optionally, force control to a known "dim count".
protected  void sendOnOffCommand(int newState)
          Send a On/Off Command to the hardware
 
Methods inherited from class jmri.AbstractVariableLight
getTransitionTime, isIntensityVariable, isTransitionAvailable, isTransitioning, notifyTargetIntensityChange, sendIntensity, setState, setTargetIntensity, setTransitionTime, startTransition
 
Methods inherited from class jmri.AbstractLight
activateLight, deactivateLight, doNewState, getControlSensorName, getControlSensorSense, getControlTimedOnSensorName, getControlTurnoutName, getControlTurnoutState, getControlType, getCurrentIntensity, getEnabled, getFastClockOffHour, getFastClockOffMin, getFastClockOnHour, getFastClockOnMin, getMaxIntensity, getMinIntensity, getState, getTargetIntensity, getTimedOnDuration, notifyStateChange, setControlSensor, setControlSensorSense, setControlTimedOnSensor, setControlTurnout, setControlTurnoutState, setControlType, setEnabled, setFastClockControlSchedule, setMaxIntensity, setMinIntensity, setTimedOnDuration, updateClockControlLight, updateIntensityHigh, updateIntensityIntermediate, updateIntensityLow
 
Methods inherited from class jmri.AbstractNamedBean
addPropertyChangeListener, dispose, firePropertyChange, getComment, getNumPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, setUserName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, dispose, getComment, getNumPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, setUserName
 

Field Detail

housecode

protected int housecode

devicecode

protected int devicecode
Constructor Detail

SerialLight

public SerialLight(String systemName)
Create a Light object, with only system name.

'systemName' was previously validated in SerialLightManager


SerialLight

public SerialLight(String systemName,
                   String userName)
Create a Light object, with both system and user names.

'systemName' was previously validated in SerialLightManager

Method Detail

initializeLight

protected void initializeLight()
Invoked from constructors to set up details. Note: most instance variables are in AbstractLight and AbstractVariableLight base classes.


initIntensity

protected void initIntensity(double intensity)
Optionally, force control to a known "dim count".

Invoked the first time intensity is set.

Default implementation doesn't do anything.


sendOnOffCommand

protected void sendOnOffCommand(int newState)
Send a On/Off Command to the hardware

Specified by:
sendOnOffCommand in class AbstractVariableLight


Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: SourceForge_Logo