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, org.lsst.ccs.framework.Configurable, 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
 
Nested classes/interfaces inherited from interface org.lsst.ccs.framework.Configurable
org.lsst.ccs.framework.Configurable.Environment
 
Field Summary
protected  CarouselModule carousel
           
protected  boolean closingLatches
           
protected  FcsEnumerations.LockStatus latchesState
           
protected  boolean openingLatches
           
static String publishedByAutoChangerOutputName
           
protected  ModuleState state
           
protected  TruckModule truckXminus
          The truck on side X-
protected  TruckModule truckXplus
          The truck on side X+
protected  boolean updatingLatches
           
 
Fields inherited from class org.lsst.ccs.framework.Module
environment, 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.
 String closeLatchesAtStandby()
          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.
 Filter getFilterOnTrucks()
           
 String getFilterOnTrucksName()
           
 CompactIOModule getFilterSensorsDIO()
           
 String getFilterSensorsDIOName()
           
 FilterLatchModule getLatchXminus()
           
 FilterLatchModule getLatchXplus()
           
 CompactIOModule getRailsSensorsDIO()
           
 String getRailsSensorsDIOName()
           
 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()
           
 boolean isHoldingFilterAtStandby()
           
abstract  boolean isMoving()
           
abstract  boolean isMovingToStandback()
           
abstract  boolean isMovingToStandby()
           
 boolean isTrucksEmpty()
           
abstract  String moveFilterToStandback(Filter aFilter)
           
abstract  String moveFilterToStandby(Filter aFilter)
           
 String openLatchesAtStandby()
           
 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 setFilterSensorsDIOName(String filterSensorsDIOName)
           
 void setLatchXminus(FilterLatchModule latchXminus)
           
 void setLatchXplus(FilterLatchModule latchXplus)
           
 void setRailsSensorsDIO(CompactIOModule railsSensorsDIO)
           
 void setRailsSensorsDIOName(String railsSensorsDIOName)
           
 void setState(ModuleState state)
           
 void setTrucksEmpty(boolean isEmpty)
           
 void setTruckXminus(TruckModule truckXminus)
           
 void setTruckXplus(TruckModule truckXplus)
           
 String toString()
           
 String ungrabFilterAtStandby()
           
 void updateLatchesStateWithSensors()
          This methods updates the latches status in reading the sensors.
abstract  void updateStateWithSensors()
           
 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, getChildren, getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, newConfigurationContext, notifyChange, notifyChangeWithoutPreliminaryChecks, 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.AutoChanger
getTrucksPosition, goToPosition, locateTrucks, moveFilterToOnline, stop
 

Field Detail

carousel

protected CarouselModule carousel

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

latchesState

protected volatile FcsEnumerations.LockStatus latchesState

updatingLatches

protected volatile boolean updatingLatches

closingLatches

protected volatile boolean closingLatches

openingLatches

protected volatile boolean openingLatches
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()

getFilterSensorsDIOName

public String getFilterSensorsDIOName()

setFilterSensorsDIOName

public void setFilterSensorsDIOName(String filterSensorsDIOName)

getRailsSensorsDIOName

public String getRailsSensorsDIOName()

setRailsSensorsDIOName

public void setRailsSensorsDIOName(String railsSensorsDIOName)

isMovingToStandback

public abstract boolean isMovingToStandback()

isMovingToStandby

public abstract boolean isMovingToStandby()

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,
                                   HardwareError,
                                   CanOpenError
Throws:
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
HardwareError
CanOpenError

goToStandback

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

moveFilterToStandby

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

moveFilterToStandback

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

updateStateWithSensors

public abstract void updateStateWithSensors()
                                     throws HardwareError,
                                            org.lsst.ccs.bus.ErrorInCommandExecutionException
Throws:
HardwareError
org.lsst.ccs.bus.ErrorInCommandExecutionException

checkPreConditionsForMotion

public void checkPreConditionsForMotion()
                                 throws org.lsst.ccs.bus.BadCommandException,
                                        HardwareError,
                                        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
HardwareError
org.lsst.ccs.bus.ErrorInCommandExecutionException

grabFilterAtStandby

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

ungrabFilterAtStandby

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

openLatchesAtStandby

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

closeLatchesAtStandby

public String closeLatchesAtStandby()
                             throws org.lsst.ccs.bus.BadCommandException,
                                    org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                    HardwareError
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:
closeLatchesAtStandby in interface AutoChanger
Returns:
Throws:
org.lsst.ccs.bus.ErrorInCommandExecutionException
org.lsst.ccs.bus.BadCommandException
HardwareError

updateLatchesStateWithSensors

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

Throws:
HardwareError
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

isHoldingFilterAtStandby

public boolean isHoldingFilterAtStandby()

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 © 2013 LSST. All Rights Reserved.