SCCS/s.action.c:

D 1.32 99/08/31 16:07:18 chris 33 32	00075/00005/01421
MRs:
COMMENTS:
ok

D 1.31 99/06/30 10:23:20 chris 32 31	00001/00000/01425
MRs:
COMMENTS:
avant dev formatage 3

D 1.30 99/04/13 18:59:05 chris 31 30	00147/00026/01278
MRs:
COMMENTS:
deniere modif avant obs de mai 99 - ctrl des params -

D 1.29 99/02/05 15:11:18 chris 30 29	00004/00004/01300
MRs:
COMMENTS:
suppression des lignes avec message_spy

D 1.28 98/09/18 15:50:17 tof 29 28	00021/00002/01283
MRs:
COMMENTS:
mise a jour de action_naxis,1,2,3 pour qu'ils ecrivent aussi le tableau dynamique...

D 1.27 98/08/07 16:38:35 chris 28 27	00020/00020/01265
MRs:
COMMENTS:
chgt float -> double

D 1.26 98/08/06 15:38:38 chris 27 26	00003/00002/01282
MRs:
COMMENTS:
Version debuguee des gros bugs tres visbles
en particulier plus de problemes sur les mauvaises
valeurs de dintg nocam et pas de plantage visible
apres les premiers tests grossiers

D 1.25 98/07/24 17:17:22 chris 26 25	00031/00065/01253
MRs:
COMMENTS:
Mise dans le tableau prevu a cet effet les info du
paracq.don qui ne dependent pas directement des fenetres (mis
apres coup)
Modification pour valider les fonctions nobuf et nocam
qui ont le sens du nom qu'on leur donne...

D 1.24 98/07/22 15:21:12 chris 25 24	00415/00411/00903
MRs:
COMMENTS:
Version de test avec creation des informations du formatage\    

D 1.23 98/05/27 17:35:17 chris 24 23	00000/00000/01314
MRs:
COMMENTS:
ajout cste NO_FREEZE dans l'init des cams

D 1.22 98/05/11 11:57:38 tof 23 22	00000/00000/01314
MRs:
COMMENTS:
rien de nouveau....

D 1.21 98/04/15 14:25:50 tof 22 21	00000/00000/01314
MRs:
COMMENTS:
rien de neuf.

D 1.20 98/03/11 18:01:19 chris 21 20	00000/00000/01314
MRs:
COMMENTS:


D 1.19 98/01/20 15:58:38 tof 20 19	00006/00006/01308
MRs:
COMMENTS:
encore des comments mis a jour ...

D 1.18 98/01/20 11:31:27 tof 19 18	00027/00002/01287
MRs:
COMMENTS:
tjrs des comments...

D 1.17 98/01/19 18:24:14 tof 18 17	00292/00092/00997
MRs:
COMMENTS:
mise a jour des comments.

D 1.16 98/01/19 16:17:56 chris 17 16	00144/00064/00945
MRs:
COMMENTS:
commentaires

D 1.15 98/01/09 13:09:21 tof 16 15	00000/00000/01009
MRs:
COMMENTS:
ai juste modifier le makefile pour changer GOAL (nom de la bibliotheque cree par le module param). Elle s'appelle desormais param.a au lieu de decode.a

D 1.14 98/01/09 09:58:57 chris 15 14	00115/00111/00894
MRs:
COMMENTS:


D 1.13 97/03/19 11:58:21 chris 14 13	00001/00001/01004
MRs:
COMMENTS:
modif pour mode OBSCU

D 1.12 96/12/18 16:10:02 chris 13 12	00002/00001/01003
MRs:
COMMENTS:
version correcte, mais revoir les tests des parametres qui sont incomplets

D 1.11 96/12/13 19:59:24 chris 12 11	00004/00002/01000
MRs:
COMMENTS:
problem ctrl param ?

D 1.10 96/12/13 13:57:45 devel 11 10	00000/00000/01002
MRs:
COMMENTS:
no coment

D 1.9 96/12/12 20:55:21 chris 10 9	00018/00016/00984
MRs:
COMMENTS:


D 1.8 96/12/12 18:01:44 chris 9 8	00000/00002/01000
MRs:
COMMENTS:
no comment

D 1.7 96/12/12 17:11:09 chris 8 7	00025/00079/00977
MRs:
COMMENTS:
modif de l'init de TB_visu en tenant compte de l'ajout des champs
numcam_de_donnee numcam_de_fenvisu status... et de la suppression de visub visui

D 1.6 96/12/12 11:58:05 chris 7 6	00000/00000/01056
MRs:
COMMENTS:
modif de init tab visu en tenant compte des derniere modifs du .h

D 1.5 96/12/09 19:06:04 chris 6 5	00063/00048/00993
MRs:
COMMENTS:
modif pour avoir les bonnes valeurs de nblig nbcol etc dans Tb_visu

D 1.4 96/12/05 14:08:06 chris 5 4	00000/00000/01041
MRs:
COMMENTS:
modif init_tb_enrg pour fich

D 1.3 96/12/03 11:05:49 chris 4 3	00000/00000/01041
MRs:
COMMENTS:


D 1.2 96/11/29 11:16:33 devel 3 1	00003/00001/01038
MRs:
COMMENTS:
Introduction de SID pour sccs

D 1.1 96/11/28 12:50:23 devel 1 0	01039/00000/00000
MRs:
COMMENTS:
date and time created 96/11/28 12:50:23 by devel

1.2	
1.2	static char *SccsId="@(#)action.c	1.32 08/31/99";
1.2	
1.14	/********************************************************************;;#h#>
1.1	-----------------
1.14	HEAD_OF_FILE:action.c
1.1	-----------------
1.16	-Authors:      C Miguel
1.17	-Library:
1.17	             param.a
1.14	-Purpose:
1.17	This File contains the functions dealing with the keywords, each keyword
1.17	corresponds to an action for the program which reads the parameter file
1.17	(FILE_RAO_PAR).
1.16	The acquisition parameters must be read and stored in memory. Once a keyword
1.16	is found in the file, the program starts the corresponding action which is
1.17	named action_<keyword found>. All the following functions are stored in a
1.16	Variable the documentation is in the def_mcle.c file.
1.1	
1.16	
1.14	-Functions:
1.1			action_modob
1.24			action_naxis3
1.24			action_themisff
1.1			action_rien
1.1			action_dingt
1.1			action_obtur
1.1			action_tpcam
1.1			action_nocam
1.16			action_nbcam
1.1			action_nblig
1.1			action_nbcol
1.1			action_ligdb
1.1			action_coldb
1.1			action_sensl
1.1			action_enreg
1.1			action_visuf
1.1			action_ctrac
1.1			action_cadac
1.1			action_nbfen
1.1			action_nbacq
1.1			action_end
1.1		 
1.14	-Comments:
1.18	
1.18	1)The functions returns:
1.17		->	0 if ok 
1.17		->	-1 if error (syntaxe ou smantique)
1.17		->	+1 when the end keyword is found.
1.16	All the lines in the parameters file start with a meaningless letter (usually
1.18	"_"), this due to a difficult compatibility between the different languages
1.16	found in the data acquisition.
1.18	
1.18	
1.18	2)The acquisition parameter file (FILE_RAO_PAR) contains a keyword by
1.18	line. One can distinguish two types of line depending of the corresponding
1.18	keyword. 
1.18	
1.18	->The first type as the format: <LISTING><H4>KEY  =      value</H4></LISTING>
1.18	->The second:<LISTING><H4>KEY indice =      value</H4></LISTIN
1.18	
1.18	So 'action' functions which correspond to keyword of the second type will
1.18	call 'extrait_indice' (cf util_param.c) inn order to extract the indice.
1.18	
1.18	3)Note that most of the 'action' functions defined here will use these three
1.18	constantes defined in param.h:
1.18	
1.18	->TAILLE_VALU: Size of the string where will be stored the value read from
1.18	the file FILE_RAO_ACQ. This string will then be converted into integer.
1.18	
1.18	->TAILLE_VAL: Size of the string (corresponding to the field value) read in
1.18	the file FILE_RAO_ACQ. Of course TAILLE_VALU >= TAILLE_VAL is preferable.
1.18	
1.18	->DEBUT_VAL: starting position (in a line of the FILE_RAO_PAR file) from
1.18	which the field 'value' can be read. DEBUT_VAL should be high enough to 
1.18	cat only 'value' (and not the previous field 'key' and 'indice').  
1.1	
1.16	-Keywords:
1.16	          keyword,parameter.
1.16	  	
1.14	;;#h#<*********************************************************************/
1.1	
1.1	
1.1	
1.1	#include <stdio.h>
1.32	#include <stdlib.h>
1.32	#include <sys/ddi.h>
1.1	
1.1	 
1.1	#include	<sun.h>
1.1	#include 	<acq.h>
1.1	#include 	<enrg.h>
1.1	#include 	<visu.h>
1.1	#include 	<param.h>
1.1	#include 	<camera.h>
1.1	#include 	<the_errno.h>
1.1	
1.1	extern Erreur the_errno;
1.24	extern FILE *fd_spy;
1.24	extern Param_info Tb_header_princ[NB_MCLE+NB_MCLE_DEPEND_FEN*NB_MAX_FEN];
1.28	extern Param_info Tb_header_dyn [NB_LI_BLOC_FITS+NB_LI_BLOC_FITS*NB_MAX_FEN];
1.1	
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_modob
1.1	------------------
1.1	
1.14	-Purpose:
1.17	        Sets the acquisition mode:
1.16		
1.16		MODE_RAO tunning, value 0.
1.16		MODE_SOL full disk, value 1.
1.16		MODE_STK stokesmetre, value 2.
1.16		MODE_TRT real time reduction, value 3 (not implemented).
1.16		MODE_REGL_SE full disk tunning, value 4.
1.16		MODE_OBSCU dark current, value 5 (not implemented).
1.1	
1.17	-Prototype:
1.17	int action_modob(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne:
1.17	Tb_enrg	*Pt_enrg:
1.17	Tb_visu	*Pt_visu:
1.17	Tb_acq	*Pt_acq:
1.17	Tb_ctrl_cam *Pt_cam:
1.16	-Example:
1.16	<LISTING><H4>
1.16	_MODOB   =                  0
1.16	</H4></LISTING>
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_modob(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.7	  char cval[TAILLE_VALU];
1.24	  char message[TAILLE_MES];
1.27	  long value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	 
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.30	    
1.1		
1.7	  if(Pt_acq!=NULL)
1.7	    {
1.30	      if( (value==MODE_RAO)||(value==MODE_STK))
1.1		{
1.7		  if(Pt_acq->modob==NOTH)
1.7		    Pt_acq->modob=value;
1.7		  else
1.7		    {
1.7		      the_errno.code=E_DECODE_REDUN;
1.7		      return(ERROR);
1.7		    }
1.1		}
1.7	      else
1.7		{
1.24		  sprintf(message,"\n modob valeur: %i",value);
1.29	
1.7		  the_errno.code=E_DECODE_SEM;
1.7		  return(ERROR);
1.7		}
1.7	    }
1.7	
1.7	  if(Pt_visu!=NULL)
1.7	    Pt_visu->modob=value;
1.7	
1.7	
1.7	  return(OK);
1.1		
1.1	}
1.1	
1.24	
1.24	action_naxis3(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.24	char	*ligne;
1.24	Tb_enrg	*Pt_enrg;
1.24	Tb_visu	*Pt_visu;
1.24	Tb_acq	*Pt_acq;
1.24	Tb_ctrl_cam *Pt_cam;
1.24	
1.24	{
1.24	
1.24	  char 	cval[TAILLE_VALU];
1.24	  int 	ind=extrait_indice(ligne);
1.27	  long 	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.24	
1.28	  Tb_header_princ[Pt_enrg->nb_li_princ].indice=_NAXIS3;
1.24	  Tb_header_princ[Pt_enrg->nb_li_princ].type=TYPE_LONG;
1.32	  Tb_header_princ[Pt_enrg->nb_li_princ].fenetre=NOTH;
1.24	  Tb_header_princ[Pt_enrg->nb_li_princ].value.type_long=value;
1.24	  Pt_enrg->nb_li_princ++;
1.24	  
1.28	  Tb_header_dyn[Pt_enrg->nb_li_dyn].indice=_NAXIS3;
1.28	  Tb_header_dyn[Pt_enrg->nb_li_dyn].type=TYPE_LONG;
1.32	  Tb_header_dyn[Pt_enrg->nb_li_dyn].fenetre=NOTH;
1.28	  Tb_header_dyn[Pt_enrg->nb_li_dyn].value.type_long=value;
1.31	  (Pt_enrg->tab_phy).naxis3=value;
1.28	  Pt_enrg->nb_li_dyn++;
1.28	  Pt_enrg->indstart_dyn++;
1.28	  
1.24	  return(OK); 
1.24	}
1.24	
1.24	
1.24	action_themisff(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.24	char	*ligne;
1.24	Tb_enrg	*Pt_enrg;
1.24	Tb_visu	*Pt_visu;
1.24	Tb_acq	*Pt_acq;
1.24	Tb_ctrl_cam *Pt_cam;
1.24	
1.24	{
1.24	  char cval[TAILLE_VALU];
1.24	  char message[TAILLE_MES];
1.24	
1.27	  long value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.24		
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.29	
1.30	
1.24	  if(Pt_acq!=NULL)
1.24	    {
1.24	      if( (value==FITS0)||(value==FITS1)||(value==FITS2)||(value==FITS3))
1.24		{
1.24		  if(Pt_acq->themisff==NOTH)
1.24		    {
1.24		      Pt_acq->themisff=value;
1.24		      Tb_header_princ[Pt_enrg->nb_li_princ].indice=_THEMISFF;
1.24		      Tb_header_princ[Pt_enrg->nb_li_princ].type=TYPE_LONG;
1.24		      Tb_header_princ[Pt_enrg->nb_li_princ].fenetre=NOTH;
1.24		      Tb_header_princ[Pt_enrg->nb_li_princ].value.type_long=value;
1.24		      Pt_enrg->nb_li_princ++;
1.24		    }
1.24		  else
1.24		    {
1.24		      the_errno.code=E_DECODE_REDUN;
1.24		      return(ERROR);
1.24		    }
1.24		}
1.24	      else
1.24		{
1.24		  printf("\n value = %i",value);
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.24		}
1.24	    }
1.24	
1.24	  if(Pt_visu!=NULL)
1.24	    Pt_visu->modob=value;
1.24	
1.24	
1.24	  return(OK);
1.24	}
1.24	
1.24	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_rien
1.1	------------------
1.1	
1.14	-Purpose:
1.17	 Does obsolutely nothing, it is the default action.
1.17	-Prototype:
1.17	int action_rien(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.17	-Return:
1.17	Just returns OK !
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_rien(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.1		return(OK);	 
1.1	}
1.1	
1.1	
1.17	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_dingt
1.1	------------------
1.1	
1.14	-Purpose:
1.17	       Sets the integration duration for each obturator (ms).
1.17	-Prototype:
1.17	int action_dintg(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne:
1.17	Tb_enrg	*Pt_enrg:
1.17	Tb_visu	*Pt_visu:
1.17	Tb_acq	*Pt_acq:
1.16	-Example:
1.17	The duration is set for the obturator 1 to 350 ms
1.17	<LISTING><H4>
1.16	_DINTG  1=                  350
1.17	</H4></LISTING>
1.17	;;#f#<*********************************************************************/
1.1	
1.1	int action_dintg(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.24	  char 	cval[TAILLE_VALU];
1.24	  int 	ind=extrait_indice(ligne);
1.27	  long  value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.24	  if(Pt_acq!=NULL)
1.24	    {
1.24	      if( (ind>=0)&&(ind<NB_MAX_OBT) )
1.1		{
1.24		  Pt_acq->dintg[ind]=value;
1.1		}
1.24	      else
1.24		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.24		}
1.24	    }
1.24	  return(OK);
1.1	}
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_obtur
1.1	------------------
1.1	
1.14	-Purpose:
1.17	     Sets the number of obturator for each buffer (camera memory)
1.17	-Prototype:
1.17	int action_obtur(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.16	-Comments:
1.16	     The value 7 (obturator) keeps it open (life saving)
1.16	-Example:
1.16	 
1.17	     The buffer number 1 corresponds to the obturator 2
1.17	<LISTING><H4>
1.16	_OBTUR  1=                    2
1.17	</H4></LISTING>
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_obtur(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	{
1.24	  char 	cval[TAILLE_VALU];
1.24	  int	ind=extrait_indice(ligne);
1.27	  long	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1		
1.24	  if(Pt_cam!=NULL)
1.24	    {
1.30	      if(((ind>=0)&&(ind<NB_MAX_CAM))&&(value>=0)&&(value<NB_MAX_OBT) )
1.1		{
1.24		  Pt_cam->tab_reg_cam[ind].n_obt=value;
1.1		}
1.24	      else
1.24		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.24		}
1.24	    }
1.24	  return(OK);
1.1	}	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_tpcam
1.1	------------------
1.1	
1.14	-Purpose:
1.17	 Sets the temperature for the cooling of the cameras
1.17	-Prototype:
1.17	int action_tpcam(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.16	-Example:
1.1	
1.17	Temperature for camera 1
1.17	<LISTING><H4>
1.16	_TPCAM  1=                  350
1.17	</H4></LISTING>
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_tpcam(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	{
1.24	  char 	cval[TAILLE_VALU];
1.24	  int	ind=extrait_indice(ligne);
1.27	  long	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.24	  if(Pt_cam!=NULL)
1.24	    {
1.30	      if(((ind>=0)&&(ind<NB_MAX_CAM))&&(value<=TEMP_MAX)&&(value>=TEMP_MIN))
1.1		{
1.24		  Pt_cam->tab_reg_cam[ind].theta=value;
1.1		}
1.24	      else
1.24		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.24		}
1.24	    }
1.24	  return(OK);
1.1	}	
1.24	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_nocam
1.1	------------------
1.1	
1.14	-Purpose:
1.24	 Sets the camera number for a window of data
1.17	-Prototype:
1.17	int action_nocam(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.1	
1.16	-Example:
1.16	
1.17	Window 1 is set to buffer 2
1.17	<LISTING><H4>
1.16	_NOCAM  1=                    2
1.17	</LISTING></H4>
1.14	;;#f#<*********************************************************************/
1.1	
1.24	
1.1	int action_nocam(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.9	  char 	cval[TAILLE_VALU];
1.9	  int 	ind=extrait_indice(ligne);
1.27	  long 	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.25	  int    i;
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.25	  i=Pt_enrg->nb_li_princ;
1.24	
1.30	  if((value>=0)&&(value<NB_MAX_CAM))
1.30	    {
1.25	
1.30	      Pt_acq->tab_info_fen[ind].nocam=value;
1.25	
1.30	      Tb_header_princ[i].indice=_NOCAM;
1.30	      Tb_header_princ[i].type=TYPE_LONG;
1.30	      Tb_header_princ[i].fenetre=ind;
1.30	      Tb_header_princ[i++].value.type_long=value;
1.30	      Pt_enrg->nb_li_princ=i;
1.30	      return(OK); 
1.30	    }
1.30	  else
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	}
1.1	
1.24	
1.25	
1.25	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.24	HEAD_OF_FUNCTION:action_nobuf
1.24	------------------
1.24	
1.24	-Purpose:
1.24	 Sets the buffer number for a window of data
1.24	-Prototype:
1.24	int action_nobuf(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.24	-Parameters:
1.24	char	*ligne :
1.24	Tb_enrg	*Pt_enrg :
1.24	Tb_visu	*Pt_visu :
1.24	Tb_acq	*Pt_acq :
1.24	Tb_ctrl_cam *Pt_cam :
1.24	
1.24	-Example:
1.24	
1.24	Window 1 is set to buffer 2
1.24	<LISTING><H4>
1.24	_NOBUF  1=                    2
1.24	</LISTING></H4>
1.24	;;#f#<*********************************************************************/
1.24	
1.24	int action_nobuf(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.24	char	*ligne;
1.24	Tb_enrg	*Pt_enrg;
1.24	Tb_visu	*Pt_visu;
1.24	Tb_acq	*Pt_acq;
1.24	Tb_ctrl_cam *Pt_cam;
1.24	
1.24	{
1.24	  char 	cval[TAILLE_VALU];
1.24	  int 	ind=extrait_indice(ligne);
1.27	  long 	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.32	  int    i,j;
1.32	  char message[TAILLE_MES];
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.25	
1.32	  i=Pt_enrg->nb_li_princ;
1.25	
1.24	  if(Pt_acq!=NULL)
1.24	    {
1.30	      if( (ind>=0)&&(ind<NB_MAX_FEN)&&(value>=0)&&(value<NB_MAX_CAM))
1.24		{
1.25		  Pt_acq->tab_info_fen[ind].nobuf=value;
1.24		  Pt_acq->tab_info_fen[ind].noplan=PLAN_IMAGE;
1.25		  
1.25		  Tb_header_princ[i++].indice=_NOBUF;
1.25		  Tb_header_princ[i++].indice=_NSHUTTER;
1.25		  Tb_header_princ[i++].indice=_TEMPCAM;
1.25		  Tb_header_princ[i++].indice=_EXPTIME;
1.25		  
1.25		  for(i=Pt_enrg->nb_li_princ;i<Pt_enrg->nb_li_princ+4;i++)
1.25		    {
1.25		      Tb_header_princ[i].type=TYPE_LONG;
1.25		      Tb_header_princ[i].fenetre=ind;
1.25		      Tb_header_princ[i].value.type_long=value;
1.25		    }
1.32		  Pt_enrg->nb_li_princ=i;
1.32	
1.24		}
1.24	      else
1.24		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.24		}
1.24	    }
1.24	  if(Pt_visu!=NULL)
1.24	    Pt_visu->numcam_de_donnee[ind]=value;
1.24	  return(OK); 
1.24	}
1.24	
1.24	/*********************************************************************;;#f#>
1.24	------------------
1.14	HEAD_OF_FUNCTION:action_nbcam
1.1	------------------
1.1	
1.14	-Purpose:
1.17	 	Sets the number of cameras in use in the observation, the value must
1.16		not exceed 32 (NB_MAX_CAM)
1.17	-Prototype:
1.17	int action_nbcam(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.17	-Example:
1.17	Use two cameras :
1.17	<LISTING> <H4>
1.17	_NBCAM   =                    2
1.17	</H4></LISTING>
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_nbcam(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.24	  char 	cval[TAILLE_VALU];
1.27	  long 	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VAL));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.24	  if(Pt_acq!=NULL)
1.24	    {
1.24	      if( (value>0)&&(value<NB_MAX_CAM) )
1.1		{
1.24		  Pt_acq->nbcam=value;
1.24	
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].indice=_NBCAM;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].type=TYPE_LONG;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].fenetre=NOTH;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].value.type_long=value;
1.24		  Pt_enrg->nb_li_princ++;
1.1		}
1.24	      else
1.24		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.24		}
1.24	    }
1.24	  return(OK); 
1.1	}
1.1	
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_nblig
1.1	------------------
1.1	
1.14	-Purpose:
1.17	Sets the number of lines of a window, the value must not exceed 512.
1.17	-Prototype:
1.17	int action_nblig(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.16	-Example:
1.16	The window 1 has 200 lines
1.17	<LISTING><H4>
1.16	_NBLIG  1=                  200
1.17	</H4></LISTING>
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_nblig(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.5	  char 	cval[TAILLE_VALU];
1.5	  int 	ind=extrait_indice(ligne);
1.27	  long	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1		
1.5	  if(Pt_acq!=NULL)
1.5	    {
1.30	      if( (ind>=0)&&(ind<NB_MAX_FEN)&&(value>0)&&(value<MAX_LIG_CCD) )
1.24		{
1.24		  Pt_acq->tab_fen[ind].nblig=value;
1.24		
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].indice=_NAXIS2;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].type=TYPE_LONG;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].fenetre=ind;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].value.type_long=value;
1.24		  Pt_enrg->nb_li_princ++;
1.28		  Tb_header_dyn[Pt_enrg->nb_li_dyn].indice=_NAXIS2;
1.28		  Tb_header_dyn[Pt_enrg->nb_li_dyn].type=TYPE_LONG;
1.28		  Tb_header_dyn[Pt_enrg->nb_li_dyn].fenetre=ind;
1.28		  Tb_header_dyn[Pt_enrg->nb_li_dyn].value.type_long=value;
1.28		  Pt_enrg->nb_li_dyn++;
1.28		  Pt_enrg->indstart_dyn++;
1.24		}
1.5	      else
1.1		{
1.5		  the_errno.code=E_DECODE_SEM;
1.5		  return(ERROR);
1.1		}
1.5	    }
1.5	
1.5	  if(Pt_visu!=NULL)
1.5	    Pt_visu->tab_fen[ind].nblig=value;
1.5	
1.5	  return(OK);
1.1	}
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_nbcol
1.1	------------------
1.1	
1.14	-Purpose:
1.17	Sets the number of columns in a window, it must not exceed 512.
1.1	
1.17	-Prototype:
1.17	int action_nbcol(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.16	-Example:
1.17	Set window 1 with 380 colums.
1.17	<LISTING><H4>
1.16	_NBCOL  1=                  380
1.17	</H4></LISTING>
1.16	
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_nbcol(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.5	  char 	cval[TAILLE_VALU];
1.5	  int 	ind=extrait_indice(ligne);
1.27	  long	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.5	  if(Pt_acq!=NULL)
1.5	    {
1.30	      if( (ind>=0)&&(ind<NB_MAX_FEN)&&(value>0)&&(value<=MAX_COL_CCD) )
1.24		{
1.24		  Pt_acq->tab_fen[ind].nbcol=value;
1.24	
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].indice=_NAXIS1;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].type=TYPE_LONG;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].fenetre=ind;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].value.type_long=value;
1.24		  Pt_enrg->nb_li_princ++;
1.28		  Tb_header_dyn[Pt_enrg->nb_li_dyn].indice=_NAXIS1;
1.28		  Tb_header_dyn[Pt_enrg->nb_li_dyn].type=TYPE_LONG;
1.28		  Tb_header_dyn[Pt_enrg->nb_li_dyn].fenetre=ind;
1.28		  Tb_header_dyn[Pt_enrg->nb_li_dyn].value.type_long=value;
1.28		  Pt_enrg->nb_li_dyn++;
1.28		  Pt_enrg->indstart_dyn++;
1.24		}
1.5	      else
1.1		{
1.5		  the_errno.code=E_DECODE_SEM;
1.5		  return(ERROR);
1.1		}
1.5	    }
1.5	  if(Pt_visu != NULL)
1.5	    Pt_visu->tab_fen[ind].nbcol=value;
1.5	
1.5	
1.5	  return(OK); 
1.1	}
1.1	
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_ligdb
1.1	------------------
1.1	
1.14	-Purpose:
1.17	Sets the number of the first line of the window
1.17	-Prototype:
1.17	int action_ligdb(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.16	-Example:
1.17	Set the first line of window 1 to the line number 1.
1.17	<LISTING><H4>
1.16	_LIGDB  1=                    1
1.17	</H4></LISTING>
1.16	
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_ligdb(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.5	  char 	cval[TAILLE_VALU];
1.5	  int 	ind=extrait_indice(ligne);
1.27	  long	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.5	  if(Pt_acq!=NULL)
1.5	    {
1.30	      if( (ind>=0)&&(ind<NB_MAX_FEN)&&(value>=0)&&(value<MAX_LIG_CCD) )
1.24		{
1.24		  Pt_acq->tab_fen[ind].ligdb=value;
1.24	
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].indice=_ROWSTART;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].type=TYPE_LONG;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].fenetre=ind;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].value.type_long=value;
1.24		  Pt_enrg->nb_li_princ++;
1.24		}
1.5	      else
1.1		{
1.5		  the_errno.code=E_DECODE_SEM;
1.5		  return(ERROR);
1.1		}
1.5	    }
1.5	  if(Pt_visu!=NULL)
1.5	    Pt_visu->tab_fen[ind].ligdb=value;
1.5	
1.5	  return(OK);
1.1	}
1.1	
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_coldb
1.1	------------------
1.1	
1.14	-Purpose:
1.17	Sets the number of the fist column of the window
1.17	-Prototype:
1.17	int action_coldb(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.16	-Example:
1.17	Set to 200 the first column of the window 1.
1.17	<LISTING><H4>
1.16	_COLDB  1=                  200
1.17	</H4></LISTING>
1.16	
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_coldb(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.5	  char 	cval[TAILLE_VALU];
1.5	  int 	ind=extrait_indice(ligne);
1.27	  long	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.5	  if(Pt_acq!=NULL)
1.5	    {
1.30	      if( (ind>=0)&&(ind<NB_MAX_FEN)&&(value>=0)&&(value<MAX_COL_CCD) )
1.24		{
1.24		  Pt_acq->tab_fen[ind].coldb=value;
1.24	
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].indice=_COLSTART;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].type=TYPE_LONG;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].fenetre=ind;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].value.type_long=value;
1.24		  Pt_enrg->nb_li_princ++;
1.24		}
1.5	      else
1.1		{
1.5		  the_errno.code=E_DECODE_SEM;
1.5		  return(ERROR);
1.1		}
1.5	    }
1.5	  if(Pt_visu != NULL)
1.5	    Pt_visu->tab_fen[ind].coldb=value;
1.5	
1.5	  return(OK);
1.1	}
1.1	
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_sensl
1.1	------------------
1.1	
1.14	-Purpose:
1.17	Sets the way of reading the data in the buffers of the cameras and of cours
1.16	the way of writing them in the VME memory (shared memory).
1.1	
1.16	0 means column by column (default value)
1.16	1 means line by line
1.17	-Prototype:
1.17	int action_sensl(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.1	
1.16	-Example:
1.17	Window 1 will be read column by column
1.17	<LISTING><H4>
1.16	_SENSL  1=                    0
1.17	</H4></LISTING>
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_sensl(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.24	  char 	cval[TAILLE_VALU];
1.24	  int 	ind=extrait_indice(ligne);
1.27	  long 	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.24	  if(Pt_acq!=NULL)
1.24	    {
1.24	      if( (value==SENS_LIG)||(value==SENS_COL) )
1.24		Pt_acq->tab_info_fen[ind].sens=value;
1.24	      else
1.1		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.1		}
1.24	    }
1.24	  return(OK); 
1.1	}
1.1	
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_enreg
1.1	------------------
1.1	
1.14	-Purpose:
1.16	Means the window is to be recorded on file
1.17	-Prototype:
1.17	int action_enreg(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.16	-Example:
1.17	Window 2 is to be recorded
1.17	<LISTING><H4>
1.16	_ENREG  2=                    1
1.17	</H4></LISTING>
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_enreg(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.24	  char 	cval[TAILLE_VALU];
1.24	  int 	ind=extrait_indice(ligne);
1.27	  long	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.26	  char  message[TAILLE_MES];
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.24	  if(Pt_enrg!=NULL)
1.24	    {
1.24	      if((ind>=0)&&(ind<NB_MAX_FEN)&&((value==1)||(value==0)) )
1.1		{
1.24		  if(Pt_enrg->numfen[ind]==NOTH)
1.26		    {	   
1.24		      Pt_enrg->numfen[ind]=value;
1.24		      if(value==1)
1.24			Pt_enrg->nbfen++;
1.24		    }
1.24		  else
1.24		    {
1.24		      the_errno.code=E_DECODE_REDUN;
1.24		      return(ERROR);
1.24		    }
1.1		}
1.24	      else
1.24		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.24		}		
1.24	    }
1.24	  return(OK); 
1.1	}
1.1	
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_visuf
1.1	------------------
1.1	
1.14	-Purpose:
1.17	Indicates which window is to be displaid on the screen.
1.17	Not in use at the moment
1.17	-Prototype:
1.17	int action_visuf(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.1	
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_visuf(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.24	  char 	cval[TAILLE_VALU];
1.24	  int 	ind=extrait_indice(ligne);
1.27	  long	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.24	  if(Pt_visu!=NULL)
1.24	    {
1.24	      if((ind>=0)&&(ind<NB_MAX_FEN)&&((value==1)||(value==0))&& 
1.24		 (Pt_visu->nbfen<NB_MAX_FEN_VISU) )
1.1		{
1.24		  if(Pt_visu->numfen[ind]==NOTH) 
1.24		    {
1.1	
1.24		      Pt_visu->numfen[ind]=value;
1.24		      if(value==1)
1.24			Pt_visu->nbfen++;
1.24		    }
1.24		  else
1.24		    {
1.24		      the_errno.code=E_DECODE_REDUN;
1.24		      return(ERROR);
1.24		    }
1.1		}
1.24	      else
1.24		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.24		}
1.24	    }
1.24	  return(OK); 
1.1	}
1.1	
1.1	
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_ctrac
1.1	------------------
1.1	
1.14	-Purpose:
1.1	
1.17	How the data acquisition are started.
1.1	
1.19	 ->CONTINU (i.e. 4) : means the acquisition never stops (the vme starts as 
1.19	soon as one is finished)
1.19	 ->CADENCEUR (i.e. 2):allows to performed a certain number of acquisition 
1.19	(defined by the keyword _NBACQ) specifying the speed of the acquisition thanks
1.19	to the keyword _CADAC.ands then stop.
1.17	 ->0 :is the simple mode, only one acquisition is made, when required.
1.16	
1.17	-Prototype:
1.17	int action_ctrac(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.16	-Example:
1.16	The acquisition mode is the simple one
1.17	<LISTING><H4>
1.16	_CTRAC   =                    0
1.17	</H4></LISTING>
1.16	
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_ctrac(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.24	  char 	cval[TAILLE_VALU];
1.27	  long 	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.24	  if(Pt_acq!=NULL)
1.24	    {
1.24	      if( (value==SIMPLE)||(value==CADENCEUR)||(value==CONTINU) )
1.24		Pt_acq->ctrac=value;
1.24	      else
1.1		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.1		}
1.24	    }
1.24	  return(OK); 
1.1	}
1.1	
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_cadac
1.1	------------------
1.1	
1.14	-Purpose:
1.17	Sets the speed of the acquisition, the value is a duration in ms. This lap 
1.16	time must take into account the numeration (250ms) and the integration
1.16	time.
1.1	
1.17	-Prototype:
1.17	int action_cadac(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.16	-Example:
1.16	One acquistion is made every 500 ms
1.17	<LISTING><H4>
1.16	_CADAC   =                  500
1.17	</H4></LISTING>
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_cadac(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.24	  char 	cval[TAILLE_VALU];
1.27	  long 	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	 
1.24	  if(Pt_acq!=NULL)
1.24	    {
1.24	      if(value>=0) 
1.24		Pt_acq->cadac=value;
1.24	      else
1.1		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.1		}
1.24	    }
1.24	  return(OK);
1.1	}
1.1	 
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_nbfen
1.1	------------------
1.1	
1.14	-Purpose:
1.17	Sets the number of windows used in the observation. It cannot be superior to
1.16	40 (which is the limit)
1.17	-Prototype:
1.17	int action_nbfen(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.16	-Example:
1.16	4 windows of data will be used in the observation
1.17	<LISTING><H4>
1.16	_NBFEN   =                    4
1.17	</H4></LISTING>
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_nbfen(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.24	  char 	cval[TAILLE_VALU];
1.24	  char message[TAILLE_MES];
1.27	  long	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.30	    
1.24	  sprintf(message,"valeur nfen: %i",value);
1.24	
1.29	
1.24	  if(Pt_acq!=NULL)
1.24	    {
1.24	      if( (value>0)&&(value<=NB_MAX_FEN) )
1.1		{
1.24		  Pt_acq->nbfen=value;
1.24	
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].indice=_NBWIN;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].type=TYPE_LONG;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].fenetre=NOTH;
1.24		  Tb_header_princ[Pt_enrg->nb_li_princ].value.type_long=value;
1.24		  Pt_enrg->nb_li_princ++;
1.1		}
1.24	      else
1.24		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.24		}
1.24	    }
1.24	  return(OK);
1.1	}
1.1	
1.1	
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_nbacq
1.1	------------------
1.1	
1.14	-Purpose:
1.17	Sets the number of acquisition that the system will do (depends on the
1.19	CTRAC value).
1.1	
1.17	-Prototype:
1.17	int action_nbacq(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.17	-Example:
1.17	To perform 10 acquisitions:
1.17	<LISTING><H4>
1.17	_NBACQ   =                   10
1.17	</H4></LISTING>
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_nbacq(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.24	  char 	cval[TAILLE_VALU];
1.27	  long	value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.30	  
1.30	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.30	    {
1.30	      the_errno.code=E_DECODE_SEM;
1.30	      return(ERROR);
1.30	    }
1.1	
1.24	  if(Pt_acq!=NULL)
1.24	    {
1.24	      if(value>=0)
1.24		Pt_acq->nbacq=value;
1.24	      else
1.1		{
1.24		  the_errno.code=E_DECODE_SEM;
1.24		  return(ERROR);
1.1		}
1.24	    }
1.24	  return(OK);
1.1	}
1.1	
1.32	action_wavlt(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.32	char	*ligne;
1.32	Tb_enrg	*Pt_enrg;
1.32	Tb_visu	*Pt_visu;
1.32	Tb_acq	*Pt_acq;
1.32	Tb_ctrl_cam *Pt_cam;
1.32	
1.32	{
1.32	  char cval[TAILLE_VAL];
1.32	  char message[TAILLE_MES];
1.32	  int  ind=extrait_indice(ligne);
1.32	  double value=atof(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.32	  
1.32	  if(ERROR==is_float(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.32	    {
1.32	      the_errno.code=E_DECODE_SEM;
1.32	      return(ERROR);
1.32	    }
1.32	
1.32	  (Pt_enrg->tab_phy).wavelnth[ind]=value;
1.32	
1.32	
1.32	
1.32	  Tb_header_princ[Pt_enrg->nb_li_princ].indice=_WAVELNTH;
1.32	  Tb_header_princ[Pt_enrg->nb_li_princ].type=TYPE_DOUBLE;
1.32	  Tb_header_princ[Pt_enrg->nb_li_princ].fenetre=ind;
1.32	  Tb_header_princ[Pt_enrg->nb_li_princ].value.type_double=value;
1.32	  Pt_enrg->nb_li_princ++;
1.32	
1.32	
1.32	  return(OK);
1.32		
1.32	}
1.32	
1.32	action_nrbuf(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.32	char	*ligne;
1.32	Tb_enrg	*Pt_enrg;
1.32	Tb_visu	*Pt_visu;
1.32	Tb_acq	*Pt_acq;
1.32	Tb_ctrl_cam *Pt_cam;
1.32	
1.32	{
1.32	  char cval[TAILLE_VAL];
1.32	  char message[TAILLE_MES];
1.32	  int  ind=extrait_indice(ligne);
1.32	  long value=atol(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU));
1.32	  
1.32	  if(ERROR==is_number(strncpy(cval,&ligne[DEBUT_VAL],TAILLE_VALU)))
1.32	    {
1.32	      the_errno.code=E_DECODE_SEM;
1.32	      return(ERROR);
1.32	    }
1.32	
1.32	  (Pt_enrg->tab_phy).nrbuf[ind]=value;
1.32	
1.32	  Tb_header_princ[Pt_enrg->nb_li_princ].indice=_NRBUF;
1.32	  Tb_header_princ[Pt_enrg->nb_li_princ].type=TYPE_LONG;
1.32	  Tb_header_princ[Pt_enrg->nb_li_princ].fenetre=ind;
1.32	  Tb_header_princ[Pt_enrg->nb_li_princ].value.type_long=value;
1.32	  Pt_enrg->nb_li_princ++;
1.32	
1.32	
1.32	
1.32	  return(OK);
1.32		
1.32	}
1.14	/*********************************************************************;;#f#>
1.1	------------------
1.14	HEAD_OF_FUNCTION:action_end
1.1	------------------
1.1	
1.14	-Purpose:
1.17	 That's the last keyword which must appear at the bottom of the 
1.16	configuration file.
1.16	It returns a different values so that the search for other keyword stops.
1.17	-Prototype:
1.17	int action_end(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam);
1.17	-Parameters:
1.17	char	*ligne :
1.17	Tb_enrg	*Pt_enrg :
1.17	Tb_visu	*Pt_visu :
1.17	Tb_acq	*Pt_acq :
1.17	Tb_ctrl_cam *Pt_cam :
1.16	-Example:
1.17	<LISTING><H4>
1.16	_END     =                    0
1.17	</H4></LISTING>
1.16	
1.14	;;#f#<*********************************************************************/
1.1	
1.1	int action_end(ligne,Pt_enrg,Pt_visu,Pt_acq,Pt_cam)
1.1	char	*ligne;
1.1	Tb_enrg	*Pt_enrg;
1.1	Tb_visu	*Pt_visu;
1.1	Tb_acq	*Pt_acq;
1.1	Tb_ctrl_cam *Pt_cam;
1.1	
1.1	{
1.1		return(DECODE_FIN);
1.1	}
1.14	
1.14	
1.14	
1.14	
1.14	
1.14	
1.14	
1.14	
1.14	
1.14	
