org.lsst.ccs.subsystems.fcs
Class BasicAutoChangerModule

java.lang.Object
  extended by java.util.Observable
      extended by org.lsst.ccs.framework.Module
          extended by org.lsst.ccs.subsystems.fcs.BasicAutoChangerModule
All Implemented Interfaces:
Serializable, Observer, AutoChanger
Direct Known Subclasses:
AutoChangerModule, SftAutoChangerModule

public abstract class BasicAutoChangerModule
extends org.lsst.ccs.framework.Module
implements AutoChanger

An abstract changer module without a fliprail, without online clamp, and without a motor. This Module is in charge of the 2 latches which hold a filter in the autochanger. This basic autochanger is used in single filter test and will be used with the final hardware too.

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  boolean lockingLatches
           
static String publishedByAutoChangerOutputName
           
protected  ModuleState state
           
protected  TruckModule truckXminus
          The truck on side X-
protected  TruckModule truckXplus
          The truck on side X+
protected  boolean unlockingLatches
           
protected  boolean updatingLatches
           
 
Fields inherited from class org.lsst.ccs.framework.Module
configMethods, log, name, nObserverThreads, registry, tickMillis
 
Constructor Summary
BasicAutoChangerModule()
           
 
Method Summary
 void checkPreConditionsForMotion()
          This method checks if the preconditions are ok before a motion of the trucks can be started.
 Filter getFilterOnTrucks()
           
 String getFilterOnTrucksName()
           
 CompactIOModule getFilterSensorsDIO()
           
 FilterLatchModule getLatchXminus()
           
 FilterLatchModule getLatchXplus()
           
 CompactIOModule getRailsSensorsDIO()
           
 ModuleState getState()
           
 StatusDataPublishedByBasicAutoChanger getStatusData()
           
 FcsEnumerations.AutoChangerTrucksLocation getTrucksLocation()
          This method returns the truckLocation if it is not been updated otherwise it waits until the end of the update.
 TruckModule getTruckXminus()
           
 TruckModule getTruckXplus()
           
abstract  String goToStandback()
           
abstract  String goToStandby()
           
 String grabFilterAtStandby(Filter filter)
           
 void initModule()
           
 boolean isAtStandback()
           
 boolean isAtStandby()
           
abstract  boolean isMoving()
           
 boolean isMovingToStandback()
           
 boolean isMovingToStandby()
           
 boolean isTrucksEmpty()
           
 String lockLatchesAtStandby(Filter aFilter)
          This methods locks the trucks latches at standby position and updates the field filterOnTrucks, the field filterLocation of the object Filter and updates the data that we publish on the status bus.
abstract  String moveFilterToStandback(Filter aFilter)
           
abstract  String moveFilterToStandby(Filter aFilter)
           
 void processUpdate(Observable source, org.lsst.ccs.framework.Module.ValueUpdate v)
          What has to be done for each tick of the timer.
 void publishDataAndNotifyObservers()
           
 void setFilterOnTrucks(Filter filterOnTrucks)
           
 void setFilterSensorsDIO(CompactIOModule filterSensorsDIO)
           
 void setLatchXminus(FilterLatchModule latchXminus)
           
 void setLatchXplus(FilterLatchModule latchXplus)
           
 void setMovingToStandback(boolean movingToStandback)
           
 void setMovingToStandby(boolean movingToStandby)
           
 void setRailsSensorsDIO(CompactIOModule railsSensorsDIO)
           
 void setState(ModuleState state)
           
 void setTrucksEmpty(boolean isEmpty)
           
 void setTruckXminus(TruckModule truckXminus)
           
 void setTruckXplus(TruckModule truckXplus)
           
 String toString()
           
 String ungrabFilterAtStandby()
           
 String unlockLatchesAtStandby()
           
 void updateLatchesStateWithSensors()
          This methods updates the latches status in reading the sensors.
 void updateTrucksLocationWithSensors()
          This methods updates the trucks location in reading the sensors.
 
Methods inherited from class org.lsst.ccs.framework.Module
change, checkHardware, dropConfigurationContext, getCheckedValueFromConfiguration, getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, newConfigurationContext, notifyChange, notifyChangeWithoutPreliminaryChecks, publishData, publishData, publishData, publishData, register, register, sendToReply, sendToStatus, setBeanName, setContext, 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.AutoChanger
getTrucksPosition, goToPosition, locateTrucks, moveFilterToOnline, stop
 

Field Detail

truckXminus

protected TruckModule truckXminus
The truck on side X-


truckXplus

protected TruckModule truckXplus
The truck on side X+


publishedByAutoChangerOutputName

public static String publishedByAutoChangerOutputName

state

protected volatile ModuleState state

updatingLatches

protected volatile boolean updatingLatches

lockingLatches

protected volatile boolean lockingLatches

unlockingLatches

protected volatile boolean unlockingLatches
Constructor Detail

BasicAutoChangerModule

public BasicAutoChangerModule()
Method Detail

getRailsSensorsDIO

public CompactIOModule getRailsSensorsDIO()

setRailsSensorsDIO

public void setRailsSensorsDIO(CompactIOModule railsSensorsDIO)

getFilterSensorsDIO

public CompactIOModule getFilterSensorsDIO()

setFilterSensorsDIO

public void setFilterSensorsDIO(CompactIOModule filterSensorsDIO)

getFilterOnTrucks

public Filter getFilterOnTrucks()
Specified by:
getFilterOnTrucks in interface AutoChanger

getState

public ModuleState getState()
Returns:
the state

setState

public void setState(ModuleState state)
Parameters:
state - the state to set

getLatchXminus

public FilterLatchModule getLatchXminus()

setLatchXminus

public void setLatchXminus(FilterLatchModule latchXminus)

getLatchXplus

public FilterLatchModule getLatchXplus()

setLatchXplus

public void setLatchXplus(FilterLatchModule latchXplus)

getTruckXminus

public TruckModule getTruckXminus()

setTruckXminus

public void setTruckXminus(TruckModule truckXminus)

getTruckXplus

public TruckModule getTruckXplus()

setTruckXplus

public void setTruckXplus(TruckModule truckXplus)

isTrucksEmpty

public boolean isTrucksEmpty()

setTrucksEmpty

public void setTrucksEmpty(boolean isEmpty)

setFilterOnTrucks

public void setFilterOnTrucks(Filter filterOnTrucks)

getFilterOnTrucksName

public String getFilterOnTrucksName()

isMovingToStandback

public boolean isMovingToStandback()

setMovingToStandback

public void setMovingToStandback(boolean movingToStandback)

isMovingToStandby

public boolean isMovingToStandby()

setMovingToStandby

public void setMovingToStandby(boolean movingToStandby)

initModule

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

processUpdate

public void processUpdate(Observable source,
                          org.lsst.ccs.framework.Module.ValueUpdate v)
What has to be done for each tick of the timer. We have to publish on the status bus.

Overrides:
processUpdate in class org.lsst.ccs.framework.Module

getStatusData

public StatusDataPublishedByBasicAutoChanger getStatusData()

publishDataAndNotifyObservers

public void publishDataAndNotifyObservers()

toString

public String toString()
Overrides:
toString in class Object

isMoving

public abstract boolean isMoving()

goToStandby

public abstract String goToStandby()
                            throws org.lsst.ccs.bus.BadCommandException,
                                   org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                   HardwareErrorDetectedException,
                                   CanOpenError
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareErrorDetectedException
CanOpenError

goToStandback

public abstract String goToStandback()
                              throws org.lsst.ccs.bus.BadCommandException,
                                     org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                     HardwareErrorDetectedException,
                                     CanOpenError
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareErrorDetectedException
CanOpenError

moveFilterToStandby

public abstract String moveFilterToStandby(Filter aFilter)
                                    throws org.lsst.ccs.bus.BadCommandException,
                                           org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                           HardwareErrorDetectedException,
                                           CanOpenError
Specified by:
moveFilterToStandby in interface AutoChanger
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareErrorDetectedException
CanOpenError

moveFilterToStandback

public abstract String moveFilterToStandback(Filter aFilter)
                                      throws org.lsst.ccs.bus.BadCommandException,
                                             org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                             HardwareErrorDetectedException,
                                             CanOpenError
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareErrorDetectedException
CanOpenError

checkPreConditionsForMotion

public void checkPreConditionsForMotion()
                                 throws org.lsst.ccs.bus.BadCommandException,
                                        HardwareErrorDetectedException,
                                        org.lsst.ccs.bus.ErrorInCommandExecutionException
This method checks if the preconditions are ok before a motion of the trucks can be started. If the preconditions are not ok, it throws a BadCommandException. A motion of the trucks can be started : if the latches are not in error and if the truks are empty or (the trucks are loaded and the latches are locked).

Throws:
org.lsst.ccs.bus.BadCommandException
HardwareErrorDetectedException
org.lsst.ccs.bus.ErrorInCommandExecutionException

grabFilterAtStandby

public String grabFilterAtStandby(Filter filter)
                           throws org.lsst.ccs.bus.BadCommandException,
                                  org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                  HardwareErrorDetectedException,
                                  CanOpenError
Specified by:
grabFilterAtStandby in interface AutoChanger
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareErrorDetectedException
CanOpenError

ungrabFilterAtStandby

public String ungrabFilterAtStandby()
                             throws org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                    org.lsst.ccs.bus.BadCommandException,
                                    HardwareErrorDetectedException,
                                    CanOpenError
Specified by:
ungrabFilterAtStandby in interface AutoChanger
Throws:
org.lsst.ccs.bus.ErrorInCommandExecutionException
org.lsst.ccs.bus.BadCommandException
HardwareErrorDetectedException
CanOpenError

unlockLatchesAtStandby

public String unlockLatchesAtStandby()
                              throws org.lsst.ccs.bus.BadCommandException,
                                     org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                     HardwareErrorDetectedException
Specified by:
unlockLatchesAtStandby in interface AutoChanger
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareErrorDetectedException

lockLatchesAtStandby

public String lockLatchesAtStandby(Filter aFilter)
                            throws org.lsst.ccs.bus.BadCommandException,
                                   org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                   HardwareErrorDetectedException
This methods locks the trucks latches at standby position and updates the field filterOnTrucks, the field filterLocation of the object Filter and updates the data that we publish on the status bus. It sends the command "lock" to the hardware of the latches and if this command is executed with success it goes on with the updates otherwise it returns an exception.

Specified by:
lockLatchesAtStandby in interface AutoChanger
Returns:
Throws:
org.lsst.ccs.bus.ErrorInCommandExecutionException
org.lsst.ccs.bus.BadCommandException
HardwareErrorDetectedException

updateLatchesStateWithSensors

public void updateLatchesStateWithSensors()
                                   throws HardwareErrorDetectedException,
                                          org.lsst.ccs.bus.ErrorInCommandExecutionException
This methods updates the latches status in reading the sensors.

Throws:
HardwareErrorDetectedException
org.lsst.ccs.bus.ErrorInCommandExecutionException

getTrucksLocation

public FcsEnumerations.AutoChangerTrucksLocation getTrucksLocation()
This method returns the truckLocation if it is not been updated otherwise it waits until the end of the update.

Returns:
the trucksLocation

isAtStandby

public boolean isAtStandby()
Specified by:
isAtStandby in interface AutoChanger
Returns:
true if the trucks are at standby position, otherwise false

isAtStandback

public boolean isAtStandback()
Returns:
true if the trucks are at standback position, otherwise false

updateTrucksLocationWithSensors

public void updateTrucksLocationWithSensors()
                                     throws org.lsst.ccs.bus.ErrorInCommandExecutionException
This methods updates the trucks location in reading the sensors.

Throws:
org.lsst.ccs.bus.ErrorInCommandExecutionException


Copyright © 2012 LSST. All Rights Reserved.