org.lsst.ccs.subsystems.fcs
Class FcsMainModule

java.lang.Object
  extended by java.util.Observable
      extended by org.lsst.ccs.framework.Module
          extended by org.lsst.ccs.subsystems.fcs.FcsMainModule
All Implemented Interfaces:
java.io.Serializable, java.util.Observer

public class FcsMainModule
extends org.lsst.ccs.framework.Module

The main module in FCS. Commands can be sent to the FcsMainModule from the CCS Master Control Module (MCM) in normal operation mode or from a Console (org.lsst.ccs.subsystem.console.TestConsole).

Example of commands that can be sent to the FcsMainModule :
Console> invoke fcs-test MoveFilterToOnline filtername

The main goals of the FcsMainModule is :

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
 
Fields inherited from class org.lsst.ccs.framework.Module
log, name, nObserverThreads, registry, tickMillis
 
Constructor Summary
FcsMainModule()
           
 
Method Summary
protected  void controlFilterName(java.lang.Object o)
          This method controls if the filter name given at the console by an operator is correct.
 java.lang.String displayData()
          This method can be invoked from the Console to display at the Console status data of the whole subsystem.
 Filter getFilterAtStandby()
           
 Filter getFilterByName(java.lang.String filterName)
           
protected  Filter getFilterOnline()
           
 java.util.Map<java.lang.String,Filter> getFilters()
           
 java.lang.Double getStandbyPosition()
           
 void initModule()
          In the initialisation, we want to do some software initialization, and some hardware initialization.
 boolean isEmptyOnline()
           
 boolean isEmptyStandBy()
           
 java.lang.String moveFilterToOnline(java.lang.Object filterName)
          Move a filter to online position.
 java.lang.String moveFilterToStandby(java.lang.Object filterName)
          Move a filter to standby position.
 java.lang.String printFilters()
           
 void processUpdate(java.util.Observable source, org.lsst.ccs.framework.Module.ValueUpdate v)
          What to do when the Modules we observe (carousel and autochanger) update their data to publish : we publish on status bus.
 void setFilters(java.util.Map<java.lang.String,Filter> filters)
           
 void setStandbyPosition(java.lang.Double standbyPosition)
           
 void shutdown()
           
 java.lang.String stop(java.lang.String moduleName)
          This method stops the FCS subsystem given as an argument.
 java.lang.String toString()
           
 
Methods inherited from class org.lsst.ccs.framework.Module
getContext, getModule, getName, getNObserverThreads, getObservables, getSubsystem, getTickMillis, init, listens, publishData, publishData, publishData, publishData, sendToReply, sendToStatus, setBeanName, setContext, setName, setNObserverThreads, setObservables, setStateModularSubsystem, setStateModularSubsystem, setTickMillis, shutdownNow, start, 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
 

Constructor Detail

FcsMainModule

public FcsMainModule()
Method Detail

initModule

public void initModule()
In the initialisation, we want to do some software initialization, and some hardware initialization. We publish the initial data for each piece of hardware : carousel and autochanger.

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

processUpdate

public void processUpdate(java.util.Observable source,
                          org.lsst.ccs.framework.Module.ValueUpdate v)
What to do when the Modules we observe (carousel and autochanger) update their data to publish : we publish on status bus.

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

printFilters

public java.lang.String printFilters()

displayData

public java.lang.String displayData()
This method can be invoked from the Console to display at the Console status data of the whole subsystem.

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

shutdown

public void shutdown()

stop

public java.lang.String stop(java.lang.String moduleName)
                      throws java.lang.IllegalArgumentException
This method stops the FCS subsystem given as an argument.

Parameters:
moduleName - cannot be null / must be : carousel, autochanger or fliprail
Throws:
java.lang.IllegalArgumentException

moveFilterToOnline

public java.lang.String moveFilterToOnline(java.lang.Object filterName)
                                    throws java.lang.InterruptedException,
                                           java.lang.IllegalArgumentException,
                                           org.lsst.ccs.bus.BadCommandException,
                                           org.lsst.ccs.bus.ErrorInCommandExecutionException,
                                           HardwareErrorDetectedException
Move a filter to online position. The filter must be in the camera. It can be on the carousel or on the autochanger. This method can be called by the end-user at the console.

Parameters:
filterName - name of the filter to move
Returns:
message for the user
Throws:
InterruptedException, - IllegalArgumentException
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
java.lang.InterruptedException
java.lang.IllegalArgumentException
HardwareErrorDetectedException

moveFilterToStandby

public java.lang.String moveFilterToStandby(java.lang.Object filterName)
                                     throws java.lang.InterruptedException,
                                            java.lang.IllegalArgumentException,
                                            org.lsst.ccs.bus.BadCommandException,
                                            org.lsst.ccs.bus.ErrorInCommandExecutionException
Move a filter to standby position. The filter must be in the camera. The filter can be on carousel or on autochanger. This method can be called by the end-user at the console.

Parameters:
filterName - name of the filter to move
Returns:
message for the user
Throws:
InterruptedException, - IllegalArgumentException
org.lsst.ccs.bus.BadCommandException
org.lsst.ccs.bus.ErrorInCommandExecutionException
java.lang.InterruptedException
java.lang.IllegalArgumentException

getFilterAtStandby

public Filter getFilterAtStandby()

controlFilterName

protected void controlFilterName(java.lang.Object o)
                          throws java.lang.IllegalArgumentException
This method controls if the filter name given at the console by an operator is correct.

Parameters:
o - the object we receive from the command line at the Console.
Throws:
java.lang.IllegalArgumentException - in this case :
  • the name is not a String,
  • the name is unknown in the map filters,
  • the name is known in the map filters, but the filter location is unknown,
  • the name is known in the map filters, but the filter is out of the camera.

getFilterByName

public Filter getFilterByName(java.lang.String filterName)

isEmptyStandBy

public boolean isEmptyStandBy()
Returns:
true if the socket at standby position on the carousel is empty (contains no filter)

isEmptyOnline

public boolean isEmptyOnline()
Returns:
true if there is no filter at online position. This can be because :
  • the autochanger truck is not at online position.
  • or the autochanger truck is at online position but it's empty.

getFilterOnline

protected Filter getFilterOnline()

getFilters

public java.util.Map<java.lang.String,Filter> getFilters()

setFilters

public void setFilters(java.util.Map<java.lang.String,Filter> filters)

getStandbyPosition

public java.lang.Double getStandbyPosition()

setStandbyPosition

public void setStandbyPosition(java.lang.Double standbyPosition)


Copyright © 2012 LSST. All Rights Reserved.