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:
java.io.Serializable, java.util.Observer, FilterClamp
Direct Known Subclasses:
CanOpenFilterClampModule, FilterClampXminusModule, FilterClampXplusModule, SimuFilterClampModule

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

An abstract class which extends Module to model a clamp that holds a filter on the carousel. It implements pattern state. See the state 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 state of the clamp. The state 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
 
Field Summary
protected  FilterPresenceStateOnClamp filterPresence
           
 StatusDataPublishedByClamp publishedByClamp
          what the clamp publishes on the status bus.
 java.lang.String publishedByClampOutputName
           
protected  FilterClampState state
           
 
Fields inherited from class org.lsst.ccs.framework.Module
log, name, nObserverThreads, registry, tickMillis
 
Constructor Summary
FilterClampModule()
           
 
Method Summary
 Sensor12bits getFilterPresenceSensor()
          For encapsulation : we want to access to filterPresenceSensor in sub-packages.
 FilterClampState getState()
           
 StatusDataPublishedByClamp getStatusData()
           
 int getValueA()
           
 int getValueB()
           
 int getValueC()
           
 void initModule()
           
 void initPublishedData()
           
 boolean isFilterEngaged()
           
abstract  boolean isLocked()
          Method to be overrided in the concrete classes : It depends on the type of the clamp.
protected  boolean isUpdateCompleted()
           
 java.lang.String release(Actuator actuator)
          The clamps on the carousel are locked automaticaly when the filter comes at the standby position.
 void setFilterPresenceSensor(Sensor12bits filterPresenceSensor)
          for Spring
 void setState(FilterClampState state)
           
protected  void setUpdateCompleted(boolean updateCompleted)
           
 void setValueA(int valueA)
           
 void setValueB(int valueB)
           
 void setValueC(int valueC)
           
 void tick()
           
 java.lang.String unlock(Actuator actuator)
          Unlock the clamp when a filter is locked by the clamp.
 void updateStateWithSensors()
          This method updates the clamp state regarding the value returned by the filter presence sensor and the value returned by the method isLocked().
 
Methods inherited from class org.lsst.ccs.framework.Module
getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, processUpdate, publishData, publishData, publishData, publishData, sendToReply, sendToStatus, setBeanName, setContext, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownNow, start, 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
 
Methods inherited from interface org.lsst.ccs.subsystems.fcs.common.FilterClamp
getName, getTickMillis
 

Field Detail

state

protected FilterClampState state

filterPresence

protected FilterPresenceStateOnClamp filterPresence

publishedByClampOutputName

public java.lang.String publishedByClampOutputName

publishedByClamp

public StatusDataPublishedByClamp publishedByClamp
what the clamp publishes on the status bus.

Constructor Detail

FilterClampModule

public FilterClampModule()
Method Detail

setValueA

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

setValueB

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

setValueC

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

getState

public FilterClampState getState()
Specified by:
getState in interface FilterClamp

setState

public void setState(FilterClampState state)
Specified by:
setState in interface FilterClamp
Parameters:
state - the state to set

isUpdateCompleted

protected boolean isUpdateCompleted()
Returns:
the updateCompleted

setUpdateCompleted

protected void setUpdateCompleted(boolean updateCompleted)
Parameters:
updateCompleted - the updateCompleted to set

getValueA

public int getValueA()
Returns:
the valueA

getValueB

public int getValueB()
Returns:
the valueB

getValueC

public int getValueC()
Returns:
the valueC

getFilterPresenceSensor

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

Specified by:
getFilterPresenceSensor in interface FilterClamp
Returns:
the filterPresenceSensor

setFilterPresenceSensor

public void setFilterPresenceSensor(Sensor12bits filterPresenceSensor)
for Spring

Parameters:
filterPresenceSensor - the filterPresenceSensor to set

isFilterEngaged

public boolean isFilterEngaged()
Specified by:
isFilterEngaged in interface FilterClamp

isLocked

public abstract boolean isLocked()
Method to be overrided in the concrete classes : It depends on the type of the clamp.

Specified by:
isLocked in interface FilterClamp
Returns:

updateStateWithSensors

public void updateStateWithSensors()
This method updates the clamp state regarding the value returned by the filter presence sensor and the value returned by the method isLocked().

Specified by:
updateStateWithSensors in interface FilterClamp

tick

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

initModule

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

initPublishedData

public void initPublishedData()

getStatusData

public StatusDataPublishedByClamp getStatusData()
Specified by:
getStatusData in interface FilterClamp

release

public java.lang.String release(Actuator actuator)
                         throws org.lsst.ccs.bus.BadCommandException,
                                org.lsst.ccs.bus.ErrorInCommandExecutionException
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.

Specified by:
release in interface FilterClamp
Returns:
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException

unlock

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

Specified by:
unlock in interface FilterClamp
Returns:
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException


Copyright © 2012 LSST. All Rights Reserved.