10 REFERENCE
10.1 COMMAND DEFINITION TABLE (CDT)
//************************************************************************
// "@(#) $Id: iracqServer.cdt,v 1.54+ 2000/12/20 16:43:00 vltsccm Exp $"
// Command Definition Table for the IR Acquisition Server.
// -------- -------- --------------------------------------------
// jstegmei 14/10/99 added -default option to SETUP command
// jstegmei 03/11/99 added -board option to CLDC command
// jstegmei 15/12/99 updated according to inscStdCmds.cdt
// jstegmei 20/12/99 added -det parameter to FRAME command
// jstegmei 21/12/99 removed -checkChop parameter from MISC command
// jstegmei 18/01/00 removed -readVoltNoCheck parameter from CLDC command
// jstegmei 18/01/00 added -checkAll parameter to CLDC command
// jstegmei 05/06/00 added -win parameter to FRAME command
// jstegmei 26/07/00 added -pollStart/Stop parameters to MISC command
// jstegmei 03/01/01 added -add, -param to FRAME command
// jstegmei 18/01/01 added -addParam, -clearParam to MISC command
//------------------------------------------------------------------------
Abort the exposure currently active.
Make DCS terminate the current exposure as quickly as possible.
Make the application exit/terminate.
// enable or disable window parameters
// parameter to enable/disable frame generation
Handle an IRACE specific command. This is a
low-level interface to all IRACE-functions.
// Add a FITS-keyword (this will automatically appear
// in all FITS-files when an exposure is started)
// Clear all FITS-keywords added with `addFitsKey'
// Dump the FITS-information into a file
// reset acquisition process loop
Commands to interact with the IRACE Number Cruncher.
Shut-down the system - make all processes terminate.
Initialize DCS with the given Detector Configuration File
Make a check of the functioning of the application and send back an
Interact with the IRACE Sequencer
Setup the functions as listed. The default flag sets
paramter to their default values as specified in the
Change to operation in Simulation Mode.
Bring the system to Stand-By State. If the haltIrace flag is
set, the IRACE front-end is reset.
Get status for various functions.
Change to Normal Operation Mode.
Return the present version of IR DCS.
Wait for current exposure to finish. The command immediately
returns an intermediate reply indicating the current exposure
status. The last reply is sent, when the exposure has finished.
10.2 iracqEVH CLASS
ccsCOMPL_STAT Init();
Initializes the control server.
The method is intended to be overwritten by the application.
It is recommended to call iracqEVH::Init first and to add
then your intitialization.
ccsCOMPL_STAT AbortServer();
Aborts the server and cleans up file structures. After a
successfull Init() this function should be called before calling
the Init() method again.
void Verbose(const char *format, ...);
Verbose output handler. This function is called from
all methods, when the macro iracqVB(...) is used.
The method is intended to be overwritten by the application.
It is recommended to call iracqEVH::VbHandler first and to
add then your own handler.
void StateHandler(int state, int subState);
Asynchronous state handler. This functions is called
whenever the server state or sub-state change.
The method is intended to be overwritten by the application.
It is recommended to call iracqEVH::StateHandler first and to
add then your own handler.
void iracqDataHandler(iracqDATA_EVT *evt);
Method to handle asynchronous events issued by the data
transfer task. The iracqDATA_EVT structure contains the
following elements:
int errorFlag; - indicates an error event
char fileName[256]; - contains the name of the file
which has been stored by the
data transfer task. Only contains
valid data, if errorFlag is not set.
char erms[256]; - contains an error message when
the errorFlag is set
The method is intended to be overwritten by the application.
It is recommended to call iracqEVH::DataHandler first and to
add then your own handler.
void ExitHandler(int sig);
Method to handle exit signals.
The method is intended to be overwritten by the application.
It is recommended to add first your own cleanup functions and
then to call iracqEVH::ExitHandler.
virtual ccsCOMPL_STAT SeqHandler(const char *seqFile,
vltINT32 *loopCmd,
vltINT32 *loopCmdLen);
This method can be overloaded to use your own parser/compiler
for the sequencer program loop. The SeqHandler method is called
by the server only if the file-extension does not match any
supported format (.seq, .prg, tcl-shell).
vltLOGICAL ExpActive();
Returns TRUE, if the exposurse is in an actives states. Otherwise
FALSE is returned.
iracqEXP_UNDEFINED
iracqEXP_INACTIVE
iracqEXP_PENDING
iracqEXP_INTEGRATING
iracqEXP_PAUSED
iracqEXP_READING_OUT
iracqEXP_PROCESSING
iracqEXP_TRANSFERRING
iracqEXP_COMPL_SUCCESS
iracqEXP_COMPL_FAILURE
iracqEXP_COMPL_ABORTED
ccsCOMPL_STAT Param2Db(const char *paramName,
const dbSYMADDRESS pointName,
const dbATTRIBUTE attrName);
Traces the value of dynamic parameter with name <paramName>
in the data base attribute <attrName>.
ccsCOMPL_STAT ReplaceEnv(char *string);
Replaces all environment variables in <string> by their
actual values.
void EnterCB(msgMESSAGE &msg,
vltINT32 updateSys = iracqNO_UPDATE);
Method to be called when entering a callback that uses
low-level irace commands.
void ExitCB(msgMESSAGE &msg);
Method to be called when leaving a callback that uses
low-level irace commands. This will also send back a
reply message.
ccsCOMPL_STAT IraceCmd(const char *cmd, const char *orgName);
Method to call a low-level irace command
virtual ccsCOMPL_STAT SetParam(const char *pname,
const char *value,
vltLOGICAL *handled);
Parameter setup function to be overloaded by an
application specific method. If the parameter has been
handled, the <handled> flag has to be set to TRUE.
ccsCOMPL_STAT GetParam(const char *pname,
char *value,
vltLOGICAL *handled);
Parameter status function to be overloaded by an
application specific method. If the parameter has been
handled, the <handled> flag has to be set to TRUE.
ccsCOMPL_STAT GetParam(const char *pname,
char *value,
vltINT32 *type,
vltLOGICAL *handled);
Additionally returns the parameter type.
Type can be one of the following:
iracqTYPE_INT - 32 bit signed integer
iracqTYPE_FLOAT - 32 bit floating point
iracqTYPE_DOUBLE - 64 bit floating point
iracqTYPE_STRING - string
iracqTYPE_LOGICAL - logical value ('T', 'F');
ccsCOMPL_STAT SetSysParam(char **param,
vltINT32 size)
Does a setup for all keywords in the parameter list pointed
to by param. Size is the number of string values in the list
and must be a multiple of 2. <param> should have the following
format:
ccsCOMPL_STAT SetSysParam(const char *keyWord,
const char *keyVal,
vltLOGICAL *handled);
Sets system parameter. If the keyWord was valid, the <handled> flag
is set to TRUE.
ccsCOMPL_STAT SetSysParam(char *paramList)
Applies a dynamic parameter list. <paramList> must have the
following format:
ccsCOMPL_STAT GetSysParam(const char *pname,
char *value,
vltINT32 *type)
Additionally returns the parameter type.
ccsCOMPL_STAT ParamDefault();
Sets all parameters back to their default values defined
in the .dsup file.
ccsCOMPL_STAT AddFrame(vltINT32 type,
char *frameName,
vltLOGICAL gen,
vltLOGICAL store,
vltLOGICAL win,
char *paramName)
Adds a new frame type. <gen> and <store> are the initial values
to indicate whether the frame should be generated/stored. If win
is set to TRUE the (sw-)window parameters are applied to the frame.
<paramName> contains to the plug-in parameter associated with
the generation of the frame type. If this is an empty string (""),
it is assumed that the frame is always generated.
ccsCOMPL_STAT BreakCnt(char *frameName, vltINT32 cnt)
Apply an exposure break-condition for the frame <frameName>
after <cnt> frames of that type have been stored by the
data transfer task.
ccsCOMPL_STAT ClearClkp();
Clears all clock patterns. This should be called before downloading
a new set of clock-pattern loops.
Only relevant, if the application provides its own sequencer
program parser/compiler.
ccsCOMPL_STAT LoadClkp(vltINT32 id,
vltINT32 *loopCmd,
vltINT32 loopCmdLen);
Downloads a clock-pattern loop. Only relevant, if the
application provides its own sequencer program parser/compiler.
ccsCOMPL_STAT LoadSeqProg(vltINT32 *loopCmd,
vltINT32 loopCmdLen);
Downloads a sequencer program loop. Only relevant, if the
application provides its own sequencer program parser/compiler.
ccsCOMPL_STAT FrameTime(vltINT32 id,
vltFLOAT *frameTime);
Returns the readout time of the clock-pattern with id <id>. If
<id> is less than zero, <frameTime> is assumed to point to an
array of frame-times, which is then updated with the readout
times of all clock-patterns.
tcomISEQ_MOD_CLK - normal running mode
tcomISEQ_MOD_TRIG_EXT - external trigger mode
tcomISEQ_MOD_TRIG_COM - trigger via command link
(reserved for test purposes)
ccsCOMPL_STAT AddFits(const char *keyword,
int *var,
const char *commentStr);
ccsCOMPL_STAT AddFits(const char *keyword,
float *var,
const char *commentStr);
ccsCOMPL_STAT AddFits(const char *keyword,
double *var,
char *commentStr);
ccsCOMPL_STAT AddFits(const char *keyword,
char *var,
const char *commentStr);
Trace the value of a variable in the FITS-header <keyword>.
ccsCOMPL_STAT int AddFits(const char *commentStr);
Add a comment to the current FITS info structure.
ccsCOMPL_STAT AddFitsDynPar(const char *keyword,
const char *commentStr);
Trace the value of a dynamic parameter in the FITS-header.
ccsCOMPL_STAT DownloadData(vltINT32 devId,
vltINT32 dataId,
const char *fileName);
Download a FITS-file to the acquisition process running on
acquisition device specified by <devId>. dataId defines the
usage of the file and can be one of the following:
The application may define other ones, as this is passed
unchecked to the acquisition process. In any case this has to
be a single bit value. fileName contains the full path name of
a FITS-file.
ccsCOMPL_STAT DownloadDataRaw(vltINT32 devId,,
vltINT32 dataId,
char *buffer,
vltINT32 size);
Download a binary buffer to the acquisition process running on
acquisition device specified by <devId>. dataId defines the
usage of the file and can be one of the following:
The application may define other ones, as this is passed
unchecked to the acquisition process. In any case this has to
be a single bit value (2^n).
ccsCOMPL_STAT ImgOp(vltINT32 op);
Perform image post-operation on data transfer task
before storing. Valid values for op are:
iracqIMG_ROT90 - rotate 90 degrees clockwise
iracqIMG_ROT180 - rotate 180 degrees
iracqIMG_ROT270 - rotate 270 degrees clockwise
iracqIMG_FLIPX - mirror on y-axis
iracqIMG_FLIPY - mirror on x-axis
Multiple image operations can be done by subsequent calls
Additionally several flags can be or'ed with the above
values to influence the application of the operations:
iracqIMG_DISABLE - enable image operations
iracqIMG_ENABLE - disable image operations
iracqIMG_CLEAR - clear all image operations
ccsCOMPL_STAT AcqParam(const char *paramString);
Sets an additional command line parameter string, which is added
to the standard command line, when the IRACE acquisition process(es)
are called.
char *AcqParam();
Returns a pointer to the additional command line parameter
string, which is added to the standard command line, when
the IRACE acquisition process(es) are called.
10.3 iracqDTT CLASS
int Init();
Initializes the control server.
The method is intended to be overwritten by the application.
It is recommended to call iracqDTT::Init first and to add
then your own intitialization.
virtual void Verbose(const char *format, ...);
Verbose output handler. This function is called from
all methods, when the macro iracqVB(...) is used.
char *FileName();
Returns the proposed FITS-file name (without extension)
depending on the selected naming scheme and the current
exposure sequence index.
int FitsAppend(const char *keyWord,
int var,
const char *comment,
char *erms);
int FitsAppend(const char *keyWord,
float var,
const char *comment,
char *erms);
int FitsAppend(const char *keyWord,
double var,
const char *comment,
char *erms);
int FitsAppend(const char *keyWord,
const char *var,
const char *comment,
char *erms);
int FitsAppend(const char *keyWord,
const char *comment,
char *erms);
Append a FITS-keyword to the local FITS-header.
int AddFits(const char *keyword,
int type,
void *addr,
const char *comment,
char *erms)
int AddFits(const char *keyword,
int *var,
const char *comment,
char *erms);
int AddFits(const char *keyword,
float *var,
const char *comment,
char *erms);
int AddFits(const char *keyword,
double *var,
char *comment,
char *erms);
int AddFits(const char *keyword,
char *var,
const char *comment,
char *erms);
Trace the value of a variable in the FITS-header <keyword>.
char *GetFitsBuf();
Returns the global null terminated FITS-buffer
filled by the control server. The number of FITS-lines
in the buffer is the length of the returned string
divided by 80.
void GetFrameName(int ftype, char *fname);
Get the name associated with the specified frame
type. If fname returns an empty string no name has
been assigned to the type by the acquisition process.
int ExpStatus();
Returns the current exposure status. Use the
iracqEXP_ISACTIVE(ExpStatus()) macro to see whether the
exposure is active or not.
char *StartTransferTime()
Returns the time when the header of a frame was received
from the acquisition process.
int DetNum();
Returns the current detector number/partition, which is
selected to be stored. If 0 is returned, all detectors
are selected.
virtual int ProcessFrame(sdmaFRAME_T *frame, char *erms);
Callback function, which is called just after a data
frame has been received from the acquisition process.
A pointer to the received frame structure is passed
via <frame>. If the function returns iracqFAILURE,
the string <erms> is sent as data error event to
the control server and the exposure is discarded.
void FrameHandled();
Call this method within ProcessFrame to signal that
all handling with the frame is done. The frame data
will then not be object to image post-processing,
scaling, display or storage.
If the function prototype allows, methods return iracqSUCCESS in
case of success. In case of failure iracqFAILURE is returned
and erms contains an error message.
10.4 iracqDTT_EVH CLASS
ccsCOMPL_STAT Init();
Initializes the control server.
The method is intended to be overwritten by the application.
It is recommended to call iracqDTT_EVH::Init first and to add
then your intitialization.
void Verbose(const char *format, ...);
Verbose output handler. This function is called from
all methods, when the macro iracqVB(...) is used.
The method is intended to be overwritten by the application.
It is recommended to call iracqEVH::VbHandler first and to
add then your own handler.
void ExitHandler(int sig);
Method to handle exit signals.
The method is intended to be overwritten by the application.
It is recommended to add first your own cleanup functions and
then to call iracqDTT_EVH::ExitHandler.
ccsCOMPL_STAT FitsAppend(const char *keyWord,
int var,
const char *comment);
ccsCOMPL_STAT FitsAppend(const char *keyWord,
float var,
const char *comment);
ccsCOMPL_STAT FitsAppend(const char *keyWord,
double var,
const char *comment);
ccsCOMPL_STAT FitsAppend(const char *keyWord,
const char *var,
const char *comment);
ccsCOMPL_STAT FitsAppend(const char *keyWord,
const char *comment);
Append a FITS-keyword to the local FITS-header.
ccsCOMPL_STAT AddFits(const char *keyword,
int *var,
const char *comment);
ccsCOMPL_STAT AddFits(const char *keyword,
float *var,
const char *comment);
ccsCOMPL_STAT AddFits(const char *keyword,
double *var,
char *comment);
ccsCOMPL_STAT AddFits(const char *keyword,
char *var,
const char *comment);
Trace the value of a variable in the FITS-header <keyword>.
10.5 iracqDTT CLASS
Quadralay Corporation http://www.webworks.com Voice: (512) 719-3399 Fax: (512) 719-3606 sales@webworks.com |