Changeset 639 in Sophya for trunk/Poubelle/archediab.old/archediab.sources/c/dilution.c
- Timestamp:
- Nov 25, 1999, 2:07:25 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Poubelle/archediab.old/archediab.sources/c/dilution.c
r637 r639 24 24 #define ecrit_switch(val,ii,bit) {if(val) ii=ii | bit ;else ii=ii& (0xffffffff^bit) ;} 25 25 #define calib(j) litD(fenetre_dilution_calibration,j,0L) 26 27 28 29 // fonction ecrit un bit des switch dilution 30 // c'est une telecommande normale 64 bit a supprimer 31 // la telecommande passe a travers le transputer sans etre traitee par lui 32 // elle arrive directement sur l'EPLD 33 26 34 void ecrit_bit_dilution(int valeur,int bit); 27 35 … … 47 55 mot_tc[5]=(i>>16)&0xff; 48 56 mot_tc[6]=(i>>24)&0xff; 57 mot_tc[7]=0; 58 emission_telecommande(tc_dir_transputer,mot_tc); 59 } 60 61 // fonction ecrit un des dac dilution 62 // c'est une telecommande normale 64 bit a supprimer 63 // la telecommande passe a travers le transputer sans etre traitee par lui 64 // elle arrive directement sur l'EPLD 65 66 void ecrit_dac_dilution(void); 67 68 void ecrit_dac_dilution(void) 69 { 70 char mot_tc[10]; 71 int k; 72 unsigned long i,j; 73 i=litD(fenetre_dilution,dil_dac_1,0); // les 2 bits adresse du dac 74 i=i<<14; i+=litD(fenetre_dilution,dil_dac_2,0); // les 12 bits valeur du dac 75 // ranger les bits a l'envers; 76 j=0; for(k=0;k<16;k++) {j=(j<<1) | (i&1);i=i>>1;} 77 mot_tc[0]=tc_dac_dil; 78 mot_tc[1]=(j)&0xff; 79 mot_tc[2]=(j>>8)&0xff; 80 mot_tc[3]=0; 81 mot_tc[4]=0; 82 mot_tc[5]=0; 83 mot_tc[6]=0; 49 84 mot_tc[7]=0; 50 85 emission_telecommande(tc_dir_transputer,mot_tc); … … 101 136 case dil_ch6 : ecrit_bit_dilution((int)valeur,chauffage6); break; 102 137 case dil_ch7 : ecrit_bit_dilution((int)valeur,chauffage7); break; 138 139 // case dil_dac_1 : 140 // case dil_dac_2 : 141 case dil_envoi_dac : ecrit_dac_dilution(); break; 103 142 104 143 default : break; … … 142 181 ecritD(fenetre_dilution,dil_EVV_retour,((blk->switch_dil&vanne_EVV)?1:0)); 143 182 183 184 185 // les temperatures sur les cartes modifiées 186 { 187 double I,V,R[4]; 188 int j,k; 189 def_gains; 190 k=0; 191 for(j=0;(j<nb_max_bolo) && (k<4);j++) 192 { 193 if(parametr.bolo[j].bolo_code_util==bolo_thermo_simplifie) 194 { 195 I = 1e-3 * (double)dac_V(gg->reglage.bolo[j]) * 2441. / parametr.bolo[j].bolo_capa; // I en µA 196 V=0.001*bol_micro_volt(blk->temperature[k],(double)parametr.bolo[j].bolo_gain*gain_ampli(gg->reglage.bolo[j])); 197 if(I>0.0000001) R[k]=V/I; else R[k]=0; // R en 198 k++; 199 } 200 } 201 202 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]); 203 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]); 204 if(litD(fenetre_dilution,dil_trace_tempe,0))// trace les sondes de niveau helium 205 { 206 int temps_cntl=numero_block(blk)*nb_per_block*2; 207 double secondes,minutes; 208 secondes=gg->periode_echantillonage*(double)temps_cntl; 209 minutes=secondes/60.; 210 if(!fenetre(fenetre_temperature_dil)) 211 { 212 nouveauD(fenetre_temperature_dil,0,"temperature_dil",0); 213 selectgra(fenetre_temperature_dil); 214 strcpy(graph->xtitre,"minutes"); 215 } 216 tracen(fenetre_temperature_dil,4,minutes,R); 217 } 218 } 219 144 220 // les pressions et debits metres des injections de la dilution 145 221 ecritD(fenetre_dilution,dil_p_d_3He,"3He: %4.1fb -> %5.2fµm/s -> %4.1fb" 146 ,40. * val_multiplex(p_R3) // 200 bars pour 5V222 ,40. * val_multiplex(p_R3) -1.6 // 200 bars pour 5V et 1.6 bar d'offset 147 223 ,2. * val_multiplex(d_3He) // 10 MICRO MOLES pour 5V 148 224 ,20. * val_multiplex(p_C3) // 100 bars pour 5V … … 151 227 ,40. * val_multiplex(p_R4) // 200 bars pour 5V 152 228 ,8. * val_multiplex(d_4He) // 40 MICRO MOLES pour 5V 229 // ,4. * val_multiplex(d_4He) // 20 MICRO MOLES pour 5V 153 230 ,20. * val_multiplex(p_C4) // 100 bars pour 5V 154 231 ); … … 227 304 // lecture des sondes de niveau helium 228 305 229 //if(blk->switch_dil & switch_helium ) 230 if(1) 306 231 307 { 232 308 double y[8]; 309 static int niveau_pre; 233 310 int niveau,fin; 311 // printf("dilution : numero de block = %d \n",numero_block(blk)); 234 312 changecontrole(fenetre_dilution,dil_niveau_helium,idem,idem,idem,idem,calrefcon(0,0,rouge,blanc,blanc),""); 235 313 y[0]=val_multiplex(j_he1)-calib(dil_j_he1); … … 241 319 y[6]=val_multiplex(j_he7)-calib(dil_j_he7); 242 320 y[7]=val_multiplex(j_he8)-calib(dil_j_he8); 243 niveau=0;fin=0; 244 for(i=0;i<8;i++) 321 if(blk->switch_dil & switch_helium) 245 322 { 246 if(y[i]>0.1) { 247 niveau++; 248 if(fin) niveau=9; 249 } 250 else fin=1; 323 changecontrole(fenetre_dilution,dil_niveau_helium,idem,idem,idem,idem,calrefcon(0,0,rouge,blanc,blanc),""); 324 niveau=0;fin=0; 325 for(i=0;i<8;i++) 326 { 327 if(y[i]>0.1) { 328 niveau++; 329 if(fin) niveau=9; 330 } 331 else fin=1; 332 } 333 // if(niveau==9) changecontrole(fenetre_dilution,dil_niveau_helium,idem,idem,idem,idem 334 // ,calrefcon(0,0,jaune,blanc,blanc),""); 335 if(niveau<niveau_pre) niveau_pre=0; 336 else {niveau_pre=niveau; ecritD(fenetre_dilution,dil_niveau_helium,niveau);} 337 // printf("niveau=%d \n",niveau); 251 338 } 252 if(niveau==9) changecontrole(fenetre_dilution,dil_niveau_helium,idem,idem,idem,idem 253 ,calrefcon(0,0,jaune,blanc,blanc),""); 254 ecritD(fenetre_dilution,dil_niveau_helium,niveau); 255 // printf("niveau=%d \n",niveau); 339 else changecontrole(fenetre_dilution,dil_niveau_helium,idem,idem,idem,idem,calrefcon(0,0,vert,blanc,blanc),""); 256 340 257 341 if(litD(fenetre_dilution,dil_trace_helium,0))// trace les sondes de niveau helium … … 270 354 } 271 355 } 272 else 273 { 274 changecontrole(fenetre_dilution,dil_niveau_helium,idem,idem,idem,idem,calrefcon(0,0,vert,blanc,blanc),""); 275 } 276 277 278 } 279 280 356 357 } 358 359
Note:
See TracChangeset
for help on using the changeset viewer.