ACAMController
Class ACAMConfigurationChange

java.lang.Object
  extended by FourMS.SequenceSubaction
      extended by ACAMController.ACAMConfigurationChange
All Implemented Interfaces:
SubActionCompletionListenerOperations, SubActionOperations, java.lang.Runnable

public class ACAMConfigurationChange
extends SequenceSubaction
implements java.lang.Runnable, SubActionOperations

This class implements a software controller level sequence subaction which will result in the specified configuration being deployed.

It allows the caller to change the mode of ACAM between spectroscopic and imaging mode and makes a series of changes to the mechanisms according to the input parameters. After the various mechanisms have been moved, it then refocuses the telescope to take into account the changes in optical components which are deployed in the light path.

Briefly, if spectroscopic mode is chosen, the selected slit is deployed and the disperser which (should be) deployed in wheel 1 is deployed as well. A clear position is selected in wheel 2.

If imaging mode is selected, the filter specified will be deployed in the wheel in which it is found and a clear position will be selected in the other wheel. The slit position will be set to position none.

The method will perform a series of checks on the configuration of the slit and the wheels to ensure that the configuration which has been requested is possible and will not move anything unless these tests are successful.

After all of the mechanisms have been moved, the method will then refocus the telescope.

It uses a series of subactions in order to move the mechanisms, wait for them finish and then refocus the telescope.

The object is a persistent CORBA object which will be registered with the name service and can then subsequently be used by CORBA client. It implements the standard SubAction IDL interface and it itself is a CORBA object which is registered with the Name service and subsequently can be invoked by remote CORBA clients.

The subaction will be registered in the name service as ACAMController/SequenceSubaction/ACAMConfigurationChange.

Version:
$Id: ACAMConfigurationChange.java,v 1.8 2010/02/19 09:35:23 cb Exp $
Author:
Craige Bevil
See Also:
ACAMFocusTelescopeSubaction

Field Summary
private  java.sql.Connection DBConnection
          This is the connection to the database which will be used for reading back filter data.
private  java.lang.String MechanismName
          This is the name of the mechanism which is to be moved.
private  OCSCORBAHelper OCSCorbaHelper
          This will be used to perform CORBA related duties
private  iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard
          This is reference to the remote proxy CORBA object which will be used to access the parameter noticeboard
private  SubAction RefocusTelescopeSubaction
          This is a reference to the instrument sequence subaction which can be used to refocus the telescope
private  SubAction SLUMechanismMovePrimitiveSubaction
          This is a reference to the SLU subaction which can be used to move the mechanism
private  SubAction WHAMechanismMovePrimitiveSubaction
          This is a reference to the WHA subaction which can be used to move the mechanism
private  SubAction WHBMechanismMovePrimitiveSubaction
          This is a reference to the WHB subaction which can be used to move the mechanism
 
Fields inherited from class FourMS.SequenceSubaction
ActionCompletionListener, ActionCompletionListenerImpl, ActionState, ExpectedNoOfArgs, InstrumentName, NumberOfSubactionsInSequenceOutstanding, Orb, Poa, RootNamingServiceContext, SecondsBeforeTimeout, SequenceSubActionInitiatorCB, SequenceSubactionName, SubactionArgumentList, SubactionThread, SyslogMessageHandler, TimeOut
 
Constructor Summary
ACAMConfigurationChange(java.lang.String SequenceSubactionName, java.lang.String InstrumentName, MessageHandler SyslogMessageHandler, int Timeout, OCSCORBAHelper OCSCorbaHelper, java.sql.Connection DBConnection)
          The constructor
 
Method Summary
 void run()
          This is the run method.
 
Methods inherited from class FourMS.SequenceSubaction
cancelAction, informSubactionInitiator, informSubactionInitiator, registerSubactionInNameService, returnResult, startAction, subActionEnded, waitForActionToComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface FourMSControllerInterfaces.SubActionOperations
cancelAction, startAction
 

Field Detail

DBConnection

private java.sql.Connection DBConnection
This is the connection to the database which will be used for reading back filter data.


MechanismName

private java.lang.String MechanismName
This is the name of the mechanism which is to be moved.


OCSCorbaHelper

private OCSCORBAHelper OCSCorbaHelper
This will be used to perform CORBA related duties


WHAMechanismMovePrimitiveSubaction

private SubAction WHAMechanismMovePrimitiveSubaction
This is a reference to the WHA subaction which can be used to move the mechanism


WHBMechanismMovePrimitiveSubaction

private SubAction WHBMechanismMovePrimitiveSubaction
This is a reference to the WHB subaction which can be used to move the mechanism


SLUMechanismMovePrimitiveSubaction

private SubAction SLUMechanismMovePrimitiveSubaction
This is a reference to the SLU subaction which can be used to move the mechanism


ParameterNoticeBoard

private iParameterNoticeBoard.ParameterNoticeBoardSupplier ParameterNoticeBoard
This is reference to the remote proxy CORBA object which will be used to access the parameter noticeboard


RefocusTelescopeSubaction

private SubAction RefocusTelescopeSubaction
This is a reference to the instrument sequence subaction which can be used to refocus the telescope

See Also:
ACAMFocusTelescopeSubaction
Constructor Detail

ACAMConfigurationChange

public ACAMConfigurationChange(java.lang.String SequenceSubactionName,
                               java.lang.String InstrumentName,
                               MessageHandler SyslogMessageHandler,
                               int Timeout,
                               OCSCORBAHelper OCSCorbaHelper,
                               java.sql.Connection DBConnection)
The constructor

Parameters:
SequenceSubactionName - This is the name of the subaction sequence for reporting purposes, this should correspond to the name that is given to the object in the name service
InstrumentName - This is the name of the instrument to which this subaction is associated
SyslogMessageHandler - A syslog message handler which will be used for error reporting
Timeout - This is timeout after which the subaction is considered to have not completed and as a result will self-cancel. It should be expressed in seconds
OCSCorbaHelper - This is used for performing various CORBA related activities.
DBConnection - A live database connection for SQL queries
Method Detail

run

public void run()
This is the run method. When the subaction is intiated, a thread is started and this is the method which is called and when the thread is started. It performs the actions which are associated with sequence subaction. Expects three arguments, which should be
Parameter number Options Description
1 IMAGING or SPECTROSCOPIC The mode we will be operating in
2 | CLEAR | NOCHANGE The demand filter position
3 | NONE | NOCHANGE The demand slit position
4 | NONE The demand disperser which is expected to be in wheel 1/A

Specified by:
run in interface java.lang.Runnable