org.lsst.ccs.subsystems.fcs
Class Sensor14bits

java.lang.Object
  extended by java.util.Observable
      extended by org.lsst.ccs.framework.Module
          extended by org.lsst.ccs.subsystems.fcs.Sensor14bits
All Implemented Interfaces:
Serializable, Observer, org.lsst.ccs.framework.Configurable, Sensor
Direct Known Subclasses:
CanOpenSensor14bits, SimuSensor14bits

public abstract class Sensor14bits
extends org.lsst.ccs.framework.Module
implements Sensor

This class represents an ADC which is a 12bits sensor : the value returned by the sensor is coded with 14 bits, so its value is between 0 and 32760.

Author:
virieux
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.lsst.ccs.framework.Module
org.lsst.ccs.framework.Module.ValueUpdate
 
Nested classes/interfaces inherited from interface org.lsst.ccs.framework.Configurable
org.lsst.ccs.framework.Configurable.Environment
 
Field Summary
protected  int value
           
 
Fields inherited from class org.lsst.ccs.framework.Module
environment, log, name, nObserverThreads, registry, tickMillis
 
Constructor Summary
Sensor14bits()
           
 
Method Summary
 int getMaxValue()
           
 int getMinValue()
           
 int getValue()
          This method returns value if the sensor is not updating otherwise it waits until the update is completed and returns the new read value from the hardware.
 void initModule()
           
 void setMinValue(int minValue)
           
 void setValue(int aValue)
           
 String toString()
           
 void updateValue()
          This method updates the sensor value : first it reads a new value from the hardware or from the simulated sensor, then it checks if the value is in the range between minimal value and maximal value.
 
Methods inherited from class org.lsst.ccs.framework.Module
change, checkHardware, dropConfigurationContext, getCheckedValueFromConfiguration, getChildren, getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, newConfigurationContext, notifyChange, notifyChangeWithoutPreliminaryChecks, processUpdate, publishData, publishData, publishData, publishData, register, register, sendToReply, sendToStatus, setBeanName, setContext, setEnvironment, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownCommand, shutdownNow, start, startTicking, tick, update
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.lsst.ccs.subsystems.fcs.common.Sensor
readNewValue
 

Field Detail

value

protected int value
Constructor Detail

Sensor14bits

public Sensor14bits()
Method Detail

initModule

public void initModule()
Overrides:
initModule in class org.lsst.ccs.framework.Module

getValue

public int getValue()
This method returns value if the sensor is not updating otherwise it waits until the update is completed and returns the new read value from the hardware.

Specified by:
getValue in interface Sensor
Returns:
value

setValue

public void setValue(int aValue)

getMaxValue

public int getMaxValue()
Returns:
the maxValue

getMinValue

public int getMinValue()

setMinValue

public void setMinValue(int minValue)

updateValue

public void updateValue()
                 throws SensorValueOutOfRangeException,
                        HardwareError
This method updates the sensor value : first it reads a new value from the hardware or from the simulated sensor, then it checks if the value is in the range between minimal value and maximal value. If it's ok it updates the sensor value with the new value, otherwise it throws an exception.

Specified by:
updateValue in interface Sensor
Throws:
SensorValueOutOfRangeException
HardwareError

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 LSST. All Rights Reserved.