1 | #include "diabolo.h"
|
---|
2 | #include "dilution.h"
|
---|
3 | #include "controle.h"
|
---|
4 |
|
---|
5 |
|
---|
6 | //-------------------- fonction exec de la fenetre : dilution -------------------------------
|
---|
7 |
|
---|
8 | #define bit0 0x01
|
---|
9 | #define bit1 0x02
|
---|
10 | #define bit2 0x04
|
---|
11 | #define bit3 0x08
|
---|
12 | #define bit4 0x10
|
---|
13 | #define bit5 0x20
|
---|
14 | #define bit6 0x40
|
---|
15 | #define bit7 0x80
|
---|
16 |
|
---|
17 |
|
---|
18 | #define cnt_temperature(i) (20+(int)val_temperature(blk->ADC_dil[i]))
|
---|
19 |
|
---|
20 | #define ecrit_switch(val,ii,bit) {if(val) ii=ii | bit ;else ii=ii& (0xffffffff^bit) ;}
|
---|
21 | #define calib(j) litD(fenetre_dilution_calibration,j,0L)
|
---|
22 |
|
---|
23 |
|
---|
24 | void ecrit_moteur_dilution(int valeur); // valeur sur 10 bit: poid fort=on/off
|
---|
25 |
|
---|
26 | void ecrit_moteur_dilution(int valeur)
|
---|
27 | {
|
---|
28 | int i;
|
---|
29 | char mot_tc[10];
|
---|
30 |
|
---|
31 | i=litD(fenetre_dilution,dil_switch_1,0);
|
---|
32 | i=i<<8; i+=litD(fenetre_dilution,dil_switch_2,0);
|
---|
33 | i=i<<8; i+=litD(fenetre_dilution,dil_switch_3,0);
|
---|
34 | i=i<<8; // les 3 octets en poid fort, rien dans le dernier octet
|
---|
35 | i=i& 0x003fffff;
|
---|
36 | i = i| ( (valeur & 0x3ff)<<22);
|
---|
37 | ecritD(fenetre_dilution,dil_switch_1,(i>>24)&0xff);
|
---|
38 | ecritD(fenetre_dilution,dil_switch_2,(i>>16)&0xff);
|
---|
39 | ecritD(fenetre_dilution,dil_switch_3,(i>>8 )&0xff);
|
---|
40 |
|
---|
41 | mot_tc[0]=tc_switch_dil;
|
---|
42 | mot_tc[1]=0;
|
---|
43 | mot_tc[2]=0;
|
---|
44 | mot_tc[3]=0;
|
---|
45 | mot_tc[4]=(i>>8 )&0xff;
|
---|
46 | mot_tc[5]=(i>>16)&0xff;
|
---|
47 | mot_tc[6]=(i>>24)&0xff;
|
---|
48 | mot_tc[7]=0;
|
---|
49 | emission_telecommande(tc_dir_transputer,mot_tc);
|
---|
50 | }
|
---|
51 |
|
---|
52 |
|
---|
53 | // fonction ecrit un bit des switch dilution
|
---|
54 | // c'est une telecommande normale 64 bit a supprimer
|
---|
55 | // la telecommande passe a travers le transputer sans etre traitee par lui
|
---|
56 | // elle arrive directement sur l'EPLD
|
---|
57 |
|
---|
58 | void ecrit_bit_dilution(int valeur,int bit);
|
---|
59 |
|
---|
60 | void ecrit_bit_dilution(int valeur,int bit)
|
---|
61 | {
|
---|
62 | int i;
|
---|
63 | char mot_tc[10];
|
---|
64 |
|
---|
65 | i=litD(fenetre_dilution,dil_switch_1,0);
|
---|
66 | i=i<<8; i+=litD(fenetre_dilution,dil_switch_2,0);
|
---|
67 | i=i<<8; i+=litD(fenetre_dilution,dil_switch_3,0);
|
---|
68 | i=i<<8; // les 3 octets en poid fort, rien dans le dernier octet
|
---|
69 | ecrit_switch(valeur,i,bit);
|
---|
70 | ecritD(fenetre_dilution,dil_switch_1,(i>>24)&0xff);
|
---|
71 | ecritD(fenetre_dilution,dil_switch_2,(i>>16)&0xff);
|
---|
72 | ecritD(fenetre_dilution,dil_switch_3,(i>>8 )&0xff);
|
---|
73 |
|
---|
74 | mot_tc[0]=tc_switch_dil;
|
---|
75 | mot_tc[1]=0;
|
---|
76 | mot_tc[2]=0;
|
---|
77 | mot_tc[3]=0;
|
---|
78 | mot_tc[4]=(i>>8 )&0xff;
|
---|
79 | mot_tc[5]=(i>>16)&0xff;
|
---|
80 | mot_tc[6]=(i>>24)&0xff;
|
---|
81 | mot_tc[7]=0;
|
---|
82 | emission_telecommande(tc_dir_transputer,mot_tc);
|
---|
83 | }
|
---|
84 |
|
---|
85 | // fonction ecrit un des dac dilution
|
---|
86 | // c'est une telecommande normale 64 bit a supprimer
|
---|
87 | // la telecommande passe a travers le transputer sans etre traitee par lui
|
---|
88 | // elle arrive directement sur l'EPLD
|
---|
89 |
|
---|
90 | void ecrit_dac_dilution(void);
|
---|
91 |
|
---|
92 | void ecrit_dac_dilution(void)
|
---|
93 | {
|
---|
94 | char mot_tc[10];
|
---|
95 | int k;
|
---|
96 | unsigned long i,j;
|
---|
97 | i=litD(fenetre_dilution,dil_dac_1,0); // les 2 bits adresse du dac
|
---|
98 | i=i<<14; i+=litD(fenetre_dilution,dil_dac_2,0); // les 12 bits valeur du dac
|
---|
99 | // ranger les bits a l'envers;
|
---|
100 | j=0; for(k=0;k<16;k++) {j=(j<<1) | (i&1);i=i>>1;}
|
---|
101 | mot_tc[0]=tc_dac_dil;
|
---|
102 | mot_tc[1]=(j)&0xff;
|
---|
103 | mot_tc[2]=(j>>8)&0xff;
|
---|
104 | mot_tc[3]=0;
|
---|
105 | mot_tc[4]=0;
|
---|
106 | mot_tc[5]=0;
|
---|
107 | mot_tc[6]=0;
|
---|
108 | mot_tc[7]=0;
|
---|
109 | emission_telecommande(tc_dir_transputer,mot_tc);
|
---|
110 | }
|
---|
111 |
|
---|
112 |
|
---|
113 |
|
---|
114 |
|
---|
115 | void exec_dilution(int fen,int item,double valeur,...)
|
---|
116 | {
|
---|
117 | int i;
|
---|
118 |
|
---|
119 | if(item>1000) item-=1000; // pour appeler le case pour tous les cara d'un edit texte
|
---|
120 |
|
---|
121 | switch(item)
|
---|
122 | {
|
---|
123 | case dil_switch_helium : ecrit_bit_dilution((int)valeur,switch_helium); break;
|
---|
124 | case dil_EVB : ecrit_bit_dilution((int)valeur,vanne_EVB); break;
|
---|
125 | case dil_EVO : ecrit_bit_dilution((int)valeur,vanne_EVO); break;
|
---|
126 | case dil_EVF : ecrit_bit_dilution((int)valeur,vanne_EVF); break;
|
---|
127 | case dil_EVV : ecrit_bit_dilution((int)valeur,vanne_EVV); break;
|
---|
128 | case dil_sw_pp5 : ecrit_bit_dilution((int)valeur,switch_pile_par_5); break;
|
---|
129 | case dil_sw_pp15 : ecrit_bit_dilution((int)valeur,switch_pile_par_15); break;
|
---|
130 |
|
---|
131 | // ---- commande directe d'un mot avec les 3 case de codage hexadecimales
|
---|
132 |
|
---|
133 | // case dil_switch_1 :
|
---|
134 | // case dil_switch_2 :
|
---|
135 | // case dil_switch_3 : ecrit_bit_dilution(0,0); break;
|
---|
136 |
|
---|
137 | // ---- telecommande du raz periodique des fets
|
---|
138 | case dil_raz_modul :
|
---|
139 | case dil_fet_raz :
|
---|
140 | {
|
---|
141 | char mot_tc[10];
|
---|
142 | mot_tc[0]=7; // commande la premiere bebo directe -> il faut ecrire tc reduite
|
---|
143 | i=litD(fen,dil_raz_modul,0);
|
---|
144 | i=i<<3;
|
---|
145 | if(litD(fen,dil_fet_raz,0)==2) i+=1;
|
---|
146 | if(litD(fen,dil_fet_raz,0)==3) i+=7;
|
---|
147 | i=i<<4;
|
---|
148 | mot_tc[1]=i;
|
---|
149 | for(i=2;i<8;i++) mot_tc[i]=0;
|
---|
150 | emission_telecommande(tc_dir_transputer,mot_tc);
|
---|
151 | }
|
---|
152 |
|
---|
153 | break;
|
---|
154 |
|
---|
155 | case dil_ch1 : ecrit_bit_dilution((int)valeur,chauffage1); break;
|
---|
156 | case dil_ch2 : ecrit_bit_dilution((int)valeur,chauffage2); break;
|
---|
157 | case dil_ch3 : ecrit_bit_dilution((int)valeur,chauffage3); break;
|
---|
158 | case dil_ch4 : ecrit_bit_dilution((int)valeur,chauffage4); break;
|
---|
159 | case dil_ch5 : ecrit_bit_dilution((int)valeur,chauffage5); break;
|
---|
160 | case dil_ch6 : ecrit_bit_dilution((int)valeur,chauffage6); break;
|
---|
161 | case dil_ch7 : ecrit_bit_dilution((int)valeur,chauffage7); break;
|
---|
162 |
|
---|
163 | // case dil_dac_1 :
|
---|
164 | // case dil_dac_2 :
|
---|
165 | // case dil_envoi_dac : ecrit_dac_dilution(); break;
|
---|
166 | case dil_envoi_dac : ecrit_moteur_dilution((int)litD(fenetre_dilution,dil_dac_2,0)); // les 12 bits
|
---|
167 | break;
|
---|
168 |
|
---|
169 | default : break;
|
---|
170 | }
|
---|
171 | }
|
---|
172 |
|
---|
173 |
|
---|
174 |
|
---|
175 |
|
---|
176 | void traite_block_dilution(block_type_dilution* blk)
|
---|
177 | {
|
---|
178 | int i;
|
---|
179 |
|
---|
180 | // ouvre la fenetre de calibration
|
---|
181 | if(!fenetre(fenetre_dilution_calibration))
|
---|
182 | nouveauD(fenetre_dilution_calibration,dilution_calibrations_id,"dilution_calibration",exec_cache);
|
---|
183 |
|
---|
184 | if( (blk->switch_dil&0x3f ) != 6 ) {
|
---|
185 | // printf("**************** affiche erreur \n");
|
---|
186 | changecontrole(fenetre_dilution,dil_erreur,idem,idem,idem,idem,idem,"erreur");
|
---|
187 | }
|
---|
188 | else {
|
---|
189 | static int q;
|
---|
190 | char ss[10]="____";
|
---|
191 | q=(q+1)&3;
|
---|
192 | ss[q]='/';
|
---|
193 | changecontrole(fenetre_dilution,dil_erreur,idem,idem,idem,idem,idem,ss);
|
---|
194 | // printf("**************** pas d' erreur \n");
|
---|
195 | }
|
---|
196 |
|
---|
197 |
|
---|
198 | // lit les switchs
|
---|
199 | // -- les voyants de fin de course vanne principale (logique negative)
|
---|
200 | ecritD(fenetre_dilution,dil_voyant_EVO,((blk->switch_dil&switch_EVO)?0:1));
|
---|
201 | ecritD(fenetre_dilution,dil_voyant_EVF,((blk->switch_dil&switch_EVF)?0:1));
|
---|
202 |
|
---|
203 | // les retour de commande des electrovannes
|
---|
204 | ecritD(fenetre_dilution,dil_EVB_retour,((blk->switch_dil&vanne_EVB)?1:0));
|
---|
205 | ecritD(fenetre_dilution,dil_EVO_retour,((blk->switch_dil&vanne_EVO)?1:0));
|
---|
206 | ecritD(fenetre_dilution,dil_EVF_retour,((blk->switch_dil&vanne_EVF)?1:0));
|
---|
207 | ecritD(fenetre_dilution,dil_EVV_retour,((blk->switch_dil&vanne_EVV)?1:0));
|
---|
208 |
|
---|
209 |
|
---|
210 |
|
---|
211 | // les temperatures sur les cartes modifiées
|
---|
212 | {
|
---|
213 | double I,V,R[4];
|
---|
214 | int j,k;
|
---|
215 | def_gains;
|
---|
216 | k=0;
|
---|
217 | for(j=0;(j<nb_max_bolo) && (k<4);j++)
|
---|
218 | {
|
---|
219 | if(parametr.bolo[j].bolo_code_util==bolo_thermo_simplifie)
|
---|
220 | {
|
---|
221 | I = 1e-3 * (double)dac_V(gg->reglage.bolo[j]) * 2441. / parametr.bolo[j].bolo_capa; // I en µA
|
---|
222 | V=0.001*bol_micro_volt(blk->temperature[k],(double)parametr.bolo[j].bolo_gain*gain_ampli(gg->reglage.bolo[j]));
|
---|
223 | if(I>0.0000001) R[k]=V/I; else R[k]=0; // R en
|
---|
224 | k++;
|
---|
225 | }
|
---|
226 | }
|
---|
227 |
|
---|
228 | if(R[0]<90.) ecritD(fenetre_dilution,dil_temp,"germ= %6.2f 4K=%5.1f 1.6K=%5.1f 10K=%5.1f",R[0],R[1],R[2],R[3]);
|
---|
229 | else ecritD(fenetre_dilution,dil_temp,"germ= %6.3fk 4K=%5.1f 1.6K=%5.1f 10K=%5.1f",R[0]*0.001,R[1],R[2],R[3]);
|
---|
230 | if(litD(fenetre_dilution,dil_trace_tempe,0))// trace les sondes de niveau helium
|
---|
231 | {
|
---|
232 | int temps_cntl=numero_block(blk)*nb_per_block*2;
|
---|
233 | double secondes,minutes;
|
---|
234 | secondes=gg->periode_echantillonage*(double)temps_cntl;
|
---|
235 | minutes=secondes/60.;
|
---|
236 | if(!fenetre(fenetre_temperature_dil))
|
---|
237 | {
|
---|
238 | nouveauD(fenetre_temperature_dil,0,"temperature_dil",0);
|
---|
239 | selectgra(fenetre_temperature_dil);
|
---|
240 | strcpy(graph->xtitre,"minutes");
|
---|
241 | }
|
---|
242 | tracen(fenetre_temperature_dil,4,minutes,R);
|
---|
243 | }
|
---|
244 | }
|
---|
245 |
|
---|
246 | // les pressions et debits metres des injections de la dilution
|
---|
247 | ecritD(fenetre_dilution,dil_p_d_3He,"3He: %4.1fb -> %5.2fµm/s -> %4.1fb"
|
---|
248 | ,40. * val_multiplex(blk->ADC_dil[ p_R3]) -1.6 // 200 bars pour 5V et 1.6 bar d'offset
|
---|
249 | ,2. * val_multiplex(blk->ADC_dil[ d_3He]) // 10 MICRO MOLES pour 5V
|
---|
250 | ,20. * val_multiplex(blk->ADC_dil[ p_C3]) // 100 bars pour 5V
|
---|
251 | );
|
---|
252 | ecritD(fenetre_dilution,dil_p_d_4He,"4He: %4.1fb -> %5.2fµm/s -> %4.1fb"
|
---|
253 | ,40. * val_multiplex(blk->ADC_dil[ p_R4]) // 200 bars pour 5V
|
---|
254 | ,8. * val_multiplex(blk->ADC_dil[ d_4He]) // 40 MICRO MOLES pour 5V
|
---|
255 | // ,4. * val_multiplex(blk->ADC_dil[ d_4He]) // 20 MICRO MOLES pour 5V
|
---|
256 | ,20. * val_multiplex(blk->ADC_dil[ p_C4]) // 100 bars pour 5V
|
---|
257 | );
|
---|
258 |
|
---|
259 | ecritD(fenetre_dilution,dil_p_air,"Van=%4.1fb charb=%4.1fb mmb=%4.3fb haut=%4.3fb"
|
---|
260 | ,20.*val_multiplex(blk->ADC_dil[ p_air]),20.*val_multiplex(blk->ADC_dil[ p_charb])
|
---|
261 | ,0.2*val_multiplex(blk->ADC_dil[ p_memb]),0.2*val_multiplex(blk->ADC_dil[ p_haut]) );
|
---|
262 |
|
---|
263 | ecritD(fenetre_dilution,dil_piles," Trp=%4.1fV Dil=%4.1fV / %4.1fV \rBebo=%4.1fV / %4.1fV / %4.1fV Ch=%4.1fV"
|
---|
264 | ,2.03*val_multiplex(blk->ADC_dil[ p_10T]),3.90*val_multiplex(blk->ADC_dil[ p_p18D]),3.90*val_multiplex(blk->ADC_dil[ p_m18D])
|
---|
265 | ,2.03*val_multiplex(blk->ADC_dil[ p_10B]),3.90*val_multiplex(blk->ADC_dil[ p_p18B]),3.90*val_multiplex(blk->ADC_dil[ p_m18B])
|
---|
266 | ,3.8*val_multiplex(blk->ADC_dil[ p_Ch]));
|
---|
267 |
|
---|
268 | /* valeur seuil au mini (5.3 ou 15.3V) , *17 = +5.9 V au maxi */
|
---|
269 |
|
---|
270 |
|
---|
271 | ecritD(fenetre_dilution,dil_p_10T,(int)(17*(2.03*val_multiplex(blk->ADC_dil[ p_10T])-5.3)));
|
---|
272 | ecritD(fenetre_dilution,dil_p_p18D,(int)(17*(3.90*val_multiplex(blk->ADC_dil[ p_p18D])-15.3)));
|
---|
273 | ecritD(fenetre_dilution,dil_p_m18D,(int)(17*(-3.90*val_multiplex(blk->ADC_dil[ p_m18D])-15.3)));
|
---|
274 | ecritD(fenetre_dilution,dil_p_10B,(int)(17*(2.03*val_multiplex(blk->ADC_dil[ p_10B])-5.3)));
|
---|
275 | ecritD(fenetre_dilution,dil_p_p18B,(int)(17*(3.93*val_multiplex(blk->ADC_dil[ p_p18B])-15.3)));
|
---|
276 | ecritD(fenetre_dilution,dil_p_m18B,(int)(17*(-3.93*val_multiplex(blk->ADC_dil[ p_m18B])-15.3)));
|
---|
277 | ecritD(fenetre_dilution,dil_p_Ch,(int)(10*(3.8*val_multiplex(blk->ADC_dil[ p_Ch])-25))); /* 25 a 35 V */
|
---|
278 |
|
---|
279 | // -- les voyants de switch de piles
|
---|
280 | ecritD(fenetre_dilution,dil_voyant_pp5,((blk->switch_dil&switch_pile_par_5)?1:0));
|
---|
281 | ecritD(fenetre_dilution,dil_voyant_pp15,((blk->switch_dil&switch_pile_par_15)?1:0));
|
---|
282 |
|
---|
283 |
|
---|
284 | ecritD(fenetre_dilution,dil_temperatures,"temp-Haut = %4.1f° %4.1f° %4.1f° %4.1f° \rtemp-Bas = %4.1f° %4.1f° %4.1f° %4.1f° "
|
---|
285 | ,val_temperature(blk->ADC_dil[ t_h1]),val_temperature(blk->ADC_dil[ t_h2]),val_temperature(blk->ADC_dil[ t_h3]),val_temperature(blk->ADC_dil[ t_h4])
|
---|
286 | ,val_temperature(blk->ADC_dil[ t_b1]),val_temperature(blk->ADC_dil[ t_b2]),val_temperature(blk->ADC_dil[ t_b3]),val_temperature(blk->ADC_dil[ t_b4])
|
---|
287 | );
|
---|
288 |
|
---|
289 | ecritD(fenetre_dilution,dil_t_h1,cnt_temperature(t_h1));
|
---|
290 | ecritD(fenetre_dilution,dil_t_h2,cnt_temperature(t_h2));
|
---|
291 | ecritD(fenetre_dilution,dil_t_h3,cnt_temperature(t_h3));
|
---|
292 | ecritD(fenetre_dilution,dil_t_h4,cnt_temperature(t_h4));
|
---|
293 | ecritD(fenetre_dilution,dil_t_a1,cnt_temperature(t_a1));
|
---|
294 | ecritD(fenetre_dilution,dil_t_a2,cnt_temperature(t_a2));
|
---|
295 | ecritD(fenetre_dilution,dil_t_a3,cnt_temperature(t_a3));
|
---|
296 | ecritD(fenetre_dilution,dil_t_a4,cnt_temperature(t_a4));
|
---|
297 | ecritD(fenetre_dilution,dil_t_b1,cnt_temperature(t_b1));
|
---|
298 | ecritD(fenetre_dilution,dil_t_b2,cnt_temperature(t_b2));
|
---|
299 | ecritD(fenetre_dilution,dil_t_b3,cnt_temperature(t_b3));
|
---|
300 | ecritD(fenetre_dilution,dil_t_b4,cnt_temperature(t_b4));
|
---|
301 |
|
---|
302 |
|
---|
303 | // les afficheurs analogiques de pression helium et pirani
|
---|
304 |
|
---|
305 | ecritD(fenetre_dilution,dil_RP_He,(int)(2500*val_multiplex(blk->ADC_dil[ RP_He])-7500));
|
---|
306 | // je veux 10000 pour 0.8 bars soit alors que l'on a 5V pour 1 bar ou 1V = 0.2 bar
|
---|
307 | // soit multiplier par 2500
|
---|
308 | // puis j'enleve 0.6 bars soit 7500
|
---|
309 | ecritD(fenetre_dilution,dil_pirani,(int)(1000*val_multiplex(blk->ADC_dil[ pirani])));
|
---|
310 |
|
---|
311 |
|
---|
312 |
|
---|
313 |
|
---|
314 |
|
---|
315 |
|
---|
316 | // ecriture des valeurs brutes de la dilution
|
---|
317 | if(litD(fenetre_dilution,dil_sortie_brute,0))
|
---|
318 | {
|
---|
319 | if(!fenetre(fenetre_dilution_lecture_brute)) nouveauT(fenetre_dilution_lecture_brute,0,"lecture dilution");
|
---|
320 |
|
---|
321 | ecritT(fenetre_dilution_lecture_brute,fin_f,"dil_switch= %x \n",blk->switch_dil);
|
---|
322 |
|
---|
323 | for(i=0;i<16;i++) ecritT(fenetre_dilution_lecture_brute,fin_f,"%2d=%6.3f ",i<8?i+11:i+13,val_multiplex(blk->ADC_dil[ i]));
|
---|
324 | ecritT(fenetre_dilution_lecture_brute,fin_f,"\n");
|
---|
325 | for(i=16;i<32;i++) ecritT(fenetre_dilution_lecture_brute,fin_f,"%2d=%6.3f ",i<24?i+15:i+17,val_multiplex(blk->ADC_dil[ i]));
|
---|
326 | ecritT(fenetre_dilution_lecture_brute,fin_f,"\n");
|
---|
327 | for(i=32;i<48;i++) ecritT(fenetre_dilution_lecture_brute,fin_f,"%2d=%6.3f ",i<40?i+19:i+21,val_multiplex(blk->ADC_dil[ i]));
|
---|
328 | ecritT(fenetre_dilution_lecture_brute,fin_f,"\n");
|
---|
329 | }
|
---|
330 | // lecture des sondes de niveau helium
|
---|
331 |
|
---|
332 |
|
---|
333 | {
|
---|
334 | double y[8];
|
---|
335 | static int niveau_pre;
|
---|
336 | int niveau,fin;
|
---|
337 | // printf("dilution : numero de block = %d \n",numero_block(blk));
|
---|
338 | changecontrole(fenetre_dilution,dil_niveau_helium,idem,idem,idem,idem,calrefcon(0,0,rouge,blanc,blanc),"");
|
---|
339 | y[0]=val_multiplex(blk->ADC_dil[ j_he1])-calib(dil_j_he1);
|
---|
340 | y[1]=val_multiplex(blk->ADC_dil[ j_he2])-calib(dil_j_he2);
|
---|
341 | y[2]=val_multiplex(blk->ADC_dil[ j_he3])-calib(dil_j_he3);
|
---|
342 | y[3]=val_multiplex(blk->ADC_dil[ j_he4])-calib(dil_j_he4);
|
---|
343 | y[4]=val_multiplex(blk->ADC_dil[ j_he5])-calib(dil_j_he5);
|
---|
344 | y[5]=val_multiplex(blk->ADC_dil[ j_he6])-calib(dil_j_he6);
|
---|
345 | y[6]=val_multiplex(blk->ADC_dil[ j_he7])-calib(dil_j_he7);
|
---|
346 | y[7]=val_multiplex(blk->ADC_dil[ j_he8])-calib(dil_j_he8);
|
---|
347 | if(blk->switch_dil & switch_helium)
|
---|
348 | {
|
---|
349 | changecontrole(fenetre_dilution,dil_niveau_helium,idem,idem,idem,idem,calrefcon(0,0,rouge,blanc,blanc),"");
|
---|
350 | niveau=0;fin=0;
|
---|
351 | for(i=0;i<8;i++)
|
---|
352 | {
|
---|
353 | if(y[i]>0.1) {
|
---|
354 | niveau++;
|
---|
355 | if(fin) niveau=9;
|
---|
356 | }
|
---|
357 | else fin=1;
|
---|
358 | }
|
---|
359 | // if(niveau==9) changecontrole(fenetre_dilution,dil_niveau_helium,idem,idem,idem,idem
|
---|
360 | // ,calrefcon(0,0,jaune,blanc,blanc),"");
|
---|
361 | if(niveau<niveau_pre) niveau_pre=0;
|
---|
362 | else {niveau_pre=niveau; ecritD(fenetre_dilution,dil_niveau_helium,niveau);}
|
---|
363 | // printf("niveau=%d \n",niveau);
|
---|
364 | }
|
---|
365 | else changecontrole(fenetre_dilution,dil_niveau_helium,idem,idem,idem,idem,calrefcon(0,0,vert,blanc,blanc),"");
|
---|
366 |
|
---|
367 | if(litD(fenetre_dilution,dil_trace_helium,0))// trace les sondes de niveau helium
|
---|
368 | {
|
---|
369 | int temps_cntl=numero_block(blk)*nb_per_block*2;
|
---|
370 | double secondes,minutes;
|
---|
371 | secondes=gg->periode_echantillonage*(double)temps_cntl;
|
---|
372 | minutes=secondes/60.;
|
---|
373 | if(!fenetre(fenetre_niveau_helium))
|
---|
374 | {
|
---|
375 | nouveauD(fenetre_niveau_helium,0,"niveau_helium",0);
|
---|
376 | selectgra(fenetre_niveau_helium);
|
---|
377 | strcpy(graph->xtitre,"minutes");
|
---|
378 | }
|
---|
379 | tracen(fenetre_niveau_helium,8,minutes,y);
|
---|
380 | }
|
---|
381 | }
|
---|
382 |
|
---|
383 | }
|
---|
384 |
|
---|
385 |
|
---|