1 | #include "diabolo.h"
|
---|
2 | #include "bolo.h"
|
---|
3 | #include "acqui.h"
|
---|
4 | #define main_nubus
|
---|
5 | #include "carte_acqui.h"
|
---|
6 | #include "trace.h"
|
---|
7 | #include "synchro.h"
|
---|
8 | #include "fichier.h"
|
---|
9 | #include "Serial.h"
|
---|
10 | #include "auto.h"
|
---|
11 | #include "menu.h"
|
---|
12 | #include "regul.h"
|
---|
13 | #include "alarme.h"
|
---|
14 | #include "controle.h"
|
---|
15 |
|
---|
16 | #include "comment.h"
|
---|
17 | #include "corel.h"
|
---|
18 | #include "version.h"
|
---|
19 | #include "config_transputer.h"
|
---|
20 | #include "dilution.h"
|
---|
21 | #include "recons_sst.h"
|
---|
22 | #include "tm.h"
|
---|
23 |
|
---|
24 | void InitSimulMission(void);
|
---|
25 |
|
---|
26 | stglob* gg; // pointeur global sur la structure
|
---|
27 |
|
---|
28 |
|
---|
29 |
|
---|
30 |
|
---|
31 | main()
|
---|
32 | {
|
---|
33 | int j,flag;
|
---|
34 | char ss[255];
|
---|
35 |
|
---|
36 | sprintf(ss,"%s:archediab_%d.rsrc",chemin_ressource,version_num);
|
---|
37 | if(!ouvrirR(ss))
|
---|
38 | {
|
---|
39 | if(alerte(2,"ne trouve pas le fichier ressource Diabolo voulez vous en ouvrir un autre ?")==1)
|
---|
40 | ouvrirR("");
|
---|
41 | else return(option_quit);
|
---|
42 | }
|
---|
43 | #ifdef _diabolo
|
---|
44 | flag=alerte(3," DIABOLO \r\r acquisition avec carte PCI ??"); // vaut 1 pour acquisition PCI
|
---|
45 | #else
|
---|
46 | //flag=alerte(3," Archeops ou Planck \r\r acquisition avec carte PCI ??"); // vaut 1 pour acquisition PCI
|
---|
47 | //flag=2; // en mode simulation
|
---|
48 | if(clavier(touche_alt) ) flag=2; else flag=1; // en mode acquisition
|
---|
49 | if(clavier(touche_controle) ) flag=4; // avec emission des telecommandes au demarrage
|
---|
50 | if(clavier(touche_alt) && clavier(touche_controle) ) {
|
---|
51 | flag=3; // en mode simulateur de donnees mission
|
---|
52 | InitSimulMission();
|
---|
53 | }
|
---|
54 | #endif
|
---|
55 |
|
---|
56 |
|
---|
57 |
|
---|
58 | init_struct(flag);
|
---|
59 |
|
---|
60 | init_recons_sst();
|
---|
61 |
|
---|
62 | //printf(" long_entete = %ld \n", sizeof(F_entete));
|
---|
63 | //printf(" long_entete_part = %ld \n", sizeof(F_entete_part));
|
---|
64 | //printf(" long_donne = %ld \n\n", sizeof(F_donne));
|
---|
65 | //return(0);
|
---|
66 |
|
---|
67 |
|
---|
68 | nouveauD(fenetre_alarme,alarme_id,"alarme",exec_alarme);
|
---|
69 | nouveauD(fenetre_controle,controle_id,"controle",exec_controle);
|
---|
70 |
|
---|
71 | nouveautypefichier('DIA2',exec_DIA2);
|
---|
72 | nouveautypefichier('ARCH',exec_ARCH);
|
---|
73 |
|
---|
74 | //nouveautypefichier('TEXT',exec_DIA2);
|
---|
75 |
|
---|
76 | nouveauM(0,diabolo_id,exec_menu_diabolo);
|
---|
77 | nouveauSM(0,menu_trace_tout_id,exec_menu_trace_tout);
|
---|
78 |
|
---|
79 | ouvreD(fenetre_acquisition,acquisition_id,"acquisition",exec_acquisition);
|
---|
80 |
|
---|
81 | ouvreD(fenetre_synchro,synchro_id,"synchro",exec_synchro);
|
---|
82 | ouvreD(fenetre_fichier,fichier_id,"fichier",exec_fichier);
|
---|
83 | //ouvreD(fenetre_auto,auto_id,"auto",exec_auto);
|
---|
84 |
|
---|
85 |
|
---|
86 | ouvre('WIND',fenetre_liste_bolos,liste_bolos_id,"liste_des_bolos",exec_cache,0L);
|
---|
87 | #ifndef _archeops
|
---|
88 | ouvreD(fenetre_choix_corel,choix_corel_id,"choix_corel",exec_choix_corel);
|
---|
89 | ouvreD(fenetre_regul,regul_id,"regul",exec_regul);
|
---|
90 | #endif
|
---|
91 |
|
---|
92 | #ifdef _archeops
|
---|
93 | //nouveauD(fenetre_vitesse_block,config_transputer_id,"config_transputer",exec_config_transputer);
|
---|
94 |
|
---|
95 | printf(" acquisition Archeops \n\n");
|
---|
96 | #endif
|
---|
97 |
|
---|
98 | initRS(port_A,baud1200+data8+stop10+noParity,0);
|
---|
99 |
|
---|
100 | #ifdef lire_les_donnees_POM2
|
---|
101 | initRS(port_A,baud19200+data8+stop20+noParity,Xon_Xoff);
|
---|
102 | printf(" avec lecture des données POM2 sur la RS232 \n");
|
---|
103 | #endif
|
---|
104 |
|
---|
105 | #ifdef lire_les_noms_sources_IRAM
|
---|
106 | printf(" avec recherche lecture des noms de source IRAM \n");
|
---|
107 | #ifdef lire_les_data_telescope_IRAM
|
---|
108 | printf("et lecture de tous les fichiers th tp de l'IRAM \n");
|
---|
109 | #endif
|
---|
110 | #endif
|
---|
111 |
|
---|
112 | for(j=0;j<nb_max_bolo;j++)
|
---|
113 | {
|
---|
114 | printf(" cherche a ouvrir bolo %d ",j+1);
|
---|
115 | printf(" capa=%g ",capa(j+1));
|
---|
116 | printf(" boloutil = %d bolonom = %s \n",parametr.bolo[j].bolo_code_util,parametr.nom_coef[parametr.bolo[j].numero_nom_coef].bolo_nom);
|
---|
117 | if(parametr.bolo[j].bolo_code_util)
|
---|
118 | {
|
---|
119 | sprintf(ss,"%d: %s",j+1,parametr.nom_coef[parametr.bolo[j].numero_nom_coef].bolo_nom);
|
---|
120 | ouvreD(j+1,bolo_id,ss,exec_bolo);
|
---|
121 | }
|
---|
122 | }
|
---|
123 | ouvreA(tache_acqui,10,"acquisition",acqui); // ouvre la tache de fond
|
---|
124 |
|
---|
125 | /*
|
---|
126 | ouvreA(tache_acqui,-1,"acquisition",acqui); // ouvre la tache de fond sans la mettre en marche
|
---|
127 | relit_liste(); // c'est relit_liste qui demarre la tache de fond d'acquisition
|
---|
128 | */
|
---|
129 |
|
---|
130 |
|
---|
131 | if( (flag==1) ou (flag==4) ) // mets en route les interruptions
|
---|
132 | {
|
---|
133 | ecritD(fenetre_acquisition,e_tache_inter,1);
|
---|
134 | exec_acquisition(fenetre_acquisition,e_tache_inter,1);
|
---|
135 | }
|
---|
136 |
|
---|
137 | select(fenetre_controle);
|
---|
138 | select(fenetre_acquisition);
|
---|
139 |
|
---|
140 | // $CHECK$ on est toujours en mode 4 avec la derniere modif AB ???
|
---|
141 | tt->PCI_actif=4;
|
---|
142 | if (flag==3) tt->PCI_actif=3;
|
---|
143 |
|
---|
144 | return(option_texte+option_unclick);
|
---|
145 | }
|
---|
146 |
|
---|
147 |
|
---|
148 |
|
---|
149 |
|
---|
150 |
|
---|
151 |
|
---|
152 | //------ fonction exec de traitement des alarmes ------------
|
---|
153 |
|
---|
154 |
|
---|
155 | void exec_alarme(int fen,int item,double valeur,...)
|
---|
156 | {
|
---|
157 | if(item==caseferme) {cache(fen);stop_exec(fen);}
|
---|
158 | if(item==ouverture) {tachedefond(fen,1800);cache(fen);} // 30 sec
|
---|
159 | if(item==tache_de_fond)
|
---|
160 | {
|
---|
161 | if( (litD(fenetre_alarme,a_fin_scan,0) ) && (!gg->scan_en_cours) )
|
---|
162 | {son(5);son(6);son(7);son(8);son(133);son(135);son(133);}
|
---|
163 | }
|
---|
164 |
|
---|
165 | }
|
---|
166 |
|
---|
167 | //------ fonction exec qui interdit la fermeture de la fenetre ------------
|
---|
168 |
|
---|
169 |
|
---|
170 | void exec_controle(int fen,int item,double valeur,...)
|
---|
171 | {
|
---|
172 | switch(item)
|
---|
173 | {
|
---|
174 | case caseferme : stop_exec(fen);break;
|
---|
175 | case con_reset_epld : reset_epld(); break;
|
---|
176 | case con_reset_trp : reset_trp(); break;
|
---|
177 | default : break;
|
---|
178 | }
|
---|
179 | }
|
---|
180 |
|
---|
181 |
|
---|
182 | //------ fonction exec qui cache la fenetre quand on la ferme ------------
|
---|
183 |
|
---|
184 | void exec_cache(int fen,int item,double valeur,...)
|
---|
185 | {
|
---|
186 | if(item==ouverture) cache(fen);
|
---|
187 | if(item==caseferme) {cache(fen);stop_exec(fen);}
|
---|
188 | }
|
---|
189 |
|
---|
190 |
|
---|