org.lsst.ccs.subsystems.fcs
Class FilterClampModule

java.lang.Object
  extended by java.util.Observable
      extended by org.lsst.ccs.framework.Module
          extended by org.lsst.ccs.subsystems.fcs.FilterClampModule
All Implemented Interfaces:
Serializable, Observer, org.lsst.ccs.framework.Configurable
Direct Known Subclasses:
FilterClampXminusModule, FilterClampXplusModule, SimuFilterClampModule

public abstract class FilterClampModule
extends org.lsst.ccs.framework.Module

An abstract class which extends Module to model a clamp that holds a filter on the carousel. It implements pattern clampState. See the clampState machine diagram for a carousel clamp. Each clamp on the carousel is coupled with a sensor which detects the presence of a filter. This abstract class provides a method to lock, unlock or release the clamps, and to compute the clampState of the clamp. The clampState of the clamp is computed, updated and published on the status bus each tick of the timer.

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  FcsEnumerations.FilterClampState clampState
           
protected  FcsEnumerations.FilterPresenceStatus filterPresenceStatus
           
 String publishedByClampOutputName
           
protected  double temperature
           
protected  boolean updatingState
           
 
Fields inherited from class org.lsst.ccs.framework.Module
environment, log, name, nObserverThreads, registry, tickMillis
 
Constructor Summary
FilterClampModule()
           
 
Method Summary
 FcsEnumerations.FilterClampState computeClampState()
          Compute the global state of the clamp given the lock sensor and the presence filter sensor state.
 ClampActuatorModule getActuator()
           
 FcsEnumerations.FilterClampState getClampState()
          Returns the clampState of the clamp.
 int getFilterPositionMaxValue()
           
 int getFilterPositionMinValue()
           
 int getFilterPositionOffset()
           
 int getFilterPositionValueA()
           
 int getFilterPositionValueB()
           
 int getFilterPositionValueC()
           
 Sensor14bits getFilterPresenceSensor()
          For encapsulation : we want to access to filterPresenceSensor in sub-packages.
 FcsEnumerations.FilterPresenceStatus getFilterPresenceStatus()
           
 Sensor14bits getLockSensor()
           
 int getLockSensorMaxValue()
           
 int getLockSensorMinValue()
           
 int getLockSensorOffset()
           
 int getLockSensorValueA()
           
 int getLockSensorValueB()
           
 int getLockSensorValueC()
           
 FcsEnumerations.LockStatus getLockStatus()
           
 StatusDataPublishedByClamp getStatusData()
           
 double getTemperature()
           
 Thermometer getThermometer()
           
 void initModule()
           
 boolean isFilterEngaged()
           
 boolean isLocked()
          This methods returns true if the clamp is locked.
 String release()
          The clamps on the carousel are locked automaticaly when the filter comes at the standby position.
 void setActuator(ClampActuatorModule actuator)
           
 void setFilterPositionMaxValue(int filterPositionMaxValue)
           
 void setFilterPositionMinValue(int filterPositionMinValue)
           
 void setFilterPositionOffset(int filterPositionOffset)
           
 void setFilterPositionValueA(int valueA)
           
 void setFilterPositionValueB(int valueB)
           
 void setFilterPositionValueC(int valueC)
           
 void setFilterPresenceSensor(Sensor14bits filterPresenceSensor)
          for Spring
 void setLockSensor(Sensor14bits lockSensor)
           
 void setLockSensorMaxValue(int lockSensorMaxValue)
           
 void setLockSensorMinValue(int lockSensorMinValue)
           
 void setLockSensorOffset(int lockSensorOffset)
           
 void setLockSensorValueA(int aValue)
           
 void setLockSensorValueB(int aValue)
           
 void setLockSensorValueC(int lockSensorValueC)
           
 void setLockStatus(FcsEnumerations.LockStatus lockStatus)
           
 void setThermometer(Thermometer thermometer)
           
 String unlock()
          Unlock the clamp when a filter is locked by the clamp.
 void updateFilterPresenceStatus()
          Update the field lockPresenceStatus in reading the filter presence sensor.
 void updateLockStatus()
          Update the field lockStatus in reading the lock sensor.
 void updateStateWithSensors()
          This method updates the clamp clampState regarding the value returned by the filter presence sensor and the value returned by the method isLocked().
 double updateTemperature()
          This methods read the thermometer, update the field temperature and returns the value sent by the thermometer;
 
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, toString, wait, wait, wait
 

Field Detail

clampState

protected FcsEnumerations.FilterClampState clampState

filterPresenceStatus

protected FcsEnumerations.FilterPresenceStatus filterPresenceStatus

temperature

protected double temperature

publishedByClampOutputName

public String publishedByClampOutputName

updatingState

protected volatile boolean updatingState
Constructor Detail

FilterClampModule

public FilterClampModule()
Method Detail

getActuator

public ClampActuatorModule getActuator()

setActuator

public void setActuator(ClampActuatorModule actuator)

setFilterPositionValueA

public void setFilterPositionValueA(int valueA)
Parameters:
filterPositionValueA - the filterPositionValueA to set

setFilterPositionValueB

public void setFilterPositionValueB(int valueB)
Parameters:
filterPositionValueB - the filterPositionValueB to set

setFilterPositionValueC

public void setFilterPositionValueC(int valueC)
Parameters:
filterPositionValueC - the filterPositionValueC to set

getLockSensorValueA

public int getLockSensorValueA()
Returns:
the lockSensorValueA

setLockSensorValueA

public void setLockSensorValueA(int aValue)
Parameters:
lockSensorValueA - the lockSensorValueA to set

getLockSensorValueB

public int getLockSensorValueB()
Returns:
the lockSensorValueB

setLockSensorValueB

public void setLockSensorValueB(int aValue)
Parameters:
lockSensorValueB - the lockSensorValueB to set

getLockSensorValueC

public int getLockSensorValueC()

setLockSensorValueC

public void setLockSensorValueC(int lockSensorValueC)

getFilterPositionMaxValue

public int getFilterPositionMaxValue()

setFilterPositionMaxValue

public void setFilterPositionMaxValue(int filterPositionMaxValue)

getFilterPositionMinValue

public int getFilterPositionMinValue()

setFilterPositionMinValue

public void setFilterPositionMinValue(int filterPositionMinValue)

getLockSensorMaxValue

public int getLockSensorMaxValue()

setLockSensorMaxValue

public void setLockSensorMaxValue(int lockSensorMaxValue)

getLockSensorMinValue

public int getLockSensorMinValue()

setLockSensorMinValue

public void setLockSensorMinValue(int lockSensorMinValue)

getFilterPositionValueA

public int getFilterPositionValueA()
Returns:
the filterPositionValueA

getFilterPositionValueB

public int getFilterPositionValueB()
Returns:
the filterPositionValueB

getFilterPositionValueC

public int getFilterPositionValueC()
Returns:
the filterPositionValueC

getLockSensorOffset

public int getLockSensorOffset()

setLockSensorOffset

public void setLockSensorOffset(int lockSensorOffset)

getFilterPositionOffset

public int getFilterPositionOffset()

setFilterPositionOffset

public void setFilterPositionOffset(int filterPositionOffset)

getFilterPresenceSensor

public Sensor14bits getFilterPresenceSensor()
For encapsulation : we want to access to filterPresenceSensor in sub-packages.

Returns:
the filterPresenceSensor

setFilterPresenceSensor

public void setFilterPresenceSensor(Sensor14bits filterPresenceSensor)
for Spring

Parameters:
filterPresenceSensor - the filterPresenceSensor to set

getLockSensor

public Sensor14bits getLockSensor()
Returns:
the lockSensor

getThermometer

public Thermometer getThermometer()

setThermometer

public void setThermometer(Thermometer thermometer)

setLockSensor

public void setLockSensor(Sensor14bits lockSensor)
Parameters:
lockSensor - the lockSensor to set

getLockStatus

public FcsEnumerations.LockStatus getLockStatus()
Returns:
the lockStatus

setLockStatus

public void setLockStatus(FcsEnumerations.LockStatus lockStatus)
Parameters:
lockStatus - the lockStatus to set

getFilterPresenceStatus

public FcsEnumerations.FilterPresenceStatus getFilterPresenceStatus()

getTemperature

public double getTemperature()

initModule

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

getClampState

public FcsEnumerations.FilterClampState getClampState()
Returns the clampState of the clamp. If the clampState is being updated and waiting for a response from a sensor, this methods waits until the clampState is updated. If the clampState is not being updated, it returns immediatly the clampState.

Returns:
clampState

isLocked

public boolean isLocked()
This methods returns true if the clamp is locked. In the simulator, it is overriden.

Returns:

isFilterEngaged

public boolean isFilterEngaged()

updateFilterPresenceStatus

public void updateFilterPresenceStatus()
                                throws HardwareError
Update the field lockPresenceStatus in reading the filter presence sensor.

Throws:
HardwareError

updateLockStatus

public void updateLockStatus()
                      throws HardwareError
Update the field lockStatus in reading the lock sensor.

Throws:
HardwareError

updateStateWithSensors

public void updateStateWithSensors()
                            throws HardwareError
This method updates the clamp clampState regarding the value returned by the filter presence sensor and the value returned by the method isLocked(). When the update is completed, it sends a signal to threads waiting to get the new value of clampState.

Throws:
HardwareError

computeClampState

public FcsEnumerations.FilterClampState computeClampState()
Compute the global state of the clamp given the lock sensor and the presence filter sensor state. This has to be overriden for the clamp X-.

Returns:
clamp state

getStatusData

public StatusDataPublishedByClamp getStatusData()

release

public String release()
               throws org.lsst.ccs.bus.BadCommandException,
                      org.lsst.ccs.bus.ErrorInCommandExecutionException,
                      HardwareError
The clamps on the carousel are locked automaticaly when the filter comes at the standby position. To be able to lock automaticaly again, it has to be released after each time it has been unlocked.

Returns:
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareError

unlock

public String unlock()
              throws org.lsst.ccs.bus.BadCommandException,
                     org.lsst.ccs.bus.ErrorInCommandExecutionException,
                     HardwareError
Unlock the clamp when a filter is locked by the clamp.

Returns:
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareError

updateTemperature

public double updateTemperature()
                         throws HardwareError
This methods read the thermometer, update the field temperature and returns the value sent by the thermometer;

Returns:
Throws:
HardwareError


Copyright © 2013 LSST. All Rights Reserved.