[637] | 1 |
|
---|
| 2 | /*======================================================================*/
|
---|
| 3 | /* */
|
---|
| 4 | /* archeops.h : structure de données */
|
---|
| 5 | /* */
|
---|
| 6 | /*======================================================================*/
|
---|
| 7 |
|
---|
| 8 | #define _archeops
|
---|
[643] | 9 | #define version_num 26
|
---|
[637] | 10 |
|
---|
| 11 |
|
---|
| 12 | /*======================================================================*/
|
---|
| 13 | /* */
|
---|
| 14 | /* historique des modifications */
|
---|
| 15 | /* */
|
---|
| 16 | /* */
|
---|
| 17 | /* VERSION 24: */
|
---|
| 18 | /* */
|
---|
| 19 | /* - utilise le fichier archeops.c */
|
---|
| 20 | /* - nb_max_bolo=24 avec nb_bolo_util=18 */
|
---|
[639] | 21 | /* - change la structure du block param */
|
---|
[637] | 22 | /* - change la structure du block dilution */
|
---|
| 23 | /* */
|
---|
[639] | 24 | /* VERSION 25: */
|
---|
| 25 | /* */
|
---|
| 26 | /* - la compression marche */
|
---|
| 27 | /* - 4 signaux synchro O.K. */
|
---|
| 28 | /* - change la structure dil : contient les temperatures */
|
---|
[637] | 29 | /* */
|
---|
[643] | 30 | /* VERSION 26: */
|
---|
| 31 | /* */
|
---|
| 32 | /* - int4 pour compatibilité toutes machines */
|
---|
[637] | 33 | /* */
|
---|
| 34 | /*======================================================================*/
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | /*======================================================================*/
|
---|
| 38 | /* --------------- parametres generaux de definition ------------- */
|
---|
| 39 | /*======================================================================*/
|
---|
[639] | 40 | #ifndef int4
|
---|
| 41 | #ifdef __alpha
|
---|
| 42 | #define int4 int
|
---|
| 43 | #undef programme
|
---|
| 44 | #else
|
---|
| 45 | #define int4 long
|
---|
| 46 | #endif
|
---|
| 47 | #endif
|
---|
| 48 |
|
---|
| 49 | #ifdef linux
|
---|
| 50 | #undef programme
|
---|
| 51 | #endif
|
---|
| 52 |
|
---|
[643] | 53 |
|
---|
[637] | 54 | #ifdef _planck
|
---|
| 55 | #define _archeops
|
---|
| 56 | #define _trapani
|
---|
| 57 | #define _sans_transputer
|
---|
| 58 | #endif
|
---|
| 59 |
|
---|
| 60 | #ifdef _archeops
|
---|
| 61 | /*#define _test_diabolo relecture des blocks fabriques avec diabolo */
|
---|
| 62 | #define _trapani /* configuration prevue pour Trapani */
|
---|
| 63 | /*#define _kiruna block standard prevu pour kiruna */
|
---|
| 64 | #endif
|
---|
| 65 |
|
---|
| 66 |
|
---|
| 67 |
|
---|
| 68 | /*======================================================================*/
|
---|
| 69 | /* -------------- valeurs des parametres dans ------------- */
|
---|
| 70 | /* -------------- les différentes configurations ------------- */
|
---|
| 71 | /*======================================================================*/
|
---|
| 72 | /* */
|
---|
| 73 | /* configuration pour Trapani : 3 bebos / 12 bolos */
|
---|
| 74 | /* */
|
---|
| 75 | /* bebo1 : voies 1 à 6 --> bolo 1 a 6 */
|
---|
| 76 | /* bebo2 : voies 9 à 14 --> bolo 7 à 12 */
|
---|
| 77 | /* */
|
---|
| 78 | /* bebo6 : */
|
---|
| 79 | /* voies 41 42 43 44 = carte simplifiee avec AMP01 */
|
---|
| 80 | /* voies 45 et 46 = chauffage pour regulation */
|
---|
| 81 | /* on ecrira plus tard le stockage des donnees simplifiees */
|
---|
| 82 | /* */
|
---|
| 83 | /* */
|
---|
| 84 | /*======================================================================*/
|
---|
| 85 |
|
---|
| 86 | /* nb_per_block doit etre divisible par 2 */
|
---|
| 87 | /* nb_max_bolo doit etre divisible par 2 pour archeops (impair pour diabolo ?? ) */
|
---|
| 88 | /* nb_bolo_util doit etre divisible par 2 pour archeops (impair pour diabolo ?? ) */
|
---|
| 89 |
|
---|
| 90 |
|
---|
| 91 | #ifdef _trapani
|
---|
| 92 | #define nb_max_bolo 24 /* nombre maxi de bolos */
|
---|
| 93 | #define nb_bolo_util 18 /* nombre de bolos réellement transmis */
|
---|
| 94 | #define nb_per_block 36 /* nombre de periodes entieres dans un block */
|
---|
| 95 | #define nb_max_mes_per 88 /* nb de points maxi dans une periode complete */
|
---|
| 96 | #define nb_photo_diodes 46 /* nb de canaux de mesure du senseur stellaire */
|
---|
| 97 | #endif
|
---|
| 98 |
|
---|
| 99 | #ifdef _kiruna
|
---|
| 100 | #define nb_max_bolo 36 /* nombre maxi de bolos */
|
---|
| 101 | #define nb_bolo_util 32 /* nombre de bolos réellement transmis */
|
---|
| 102 | #define nb_per_block 36 /* nombre de periodes entieres dans un block */
|
---|
| 103 | #define nb_max_mes_per 88 /* nb de points maxi dans une periode complete */
|
---|
| 104 | #define nb_photo_diodes 46 /* nb de canaux de mesure du senseur stellaire */
|
---|
| 105 | #endif
|
---|
| 106 |
|
---|
| 107 |
|
---|
| 108 | #ifdef _diabolo
|
---|
| 109 | #define nb_max_bolo 9 /* nombre maxi de bolos */
|
---|
| 110 | #define nb_bolo_util 9 /* nombre de bolos réellement transmis */
|
---|
| 111 | #define nb_per_block 20 /* nombre de periodes entieres dans un block */
|
---|
| 112 | #define nb_max_mes_per 128 /* nb de points maxi dans une periode complete */
|
---|
| 113 | #define nb_photo_diodes 0 /* nb de canaux de mesure du senseur stellaire */
|
---|
| 114 | #endif
|
---|
| 115 |
|
---|
| 116 | #ifdef _test_diabolo
|
---|
| 117 | #define nb_max_bolo 9 /* nombre maxi de bolos */
|
---|
| 118 | #define nb_bolo_util 9 /* nombre de bolos réellement transmis */
|
---|
| 119 | #define nb_per_block 20 /* nombre de periodes entieres dans un block */
|
---|
| 120 | #define nb_max_mes_per 128 /* nb de points maxi dans une periode complete */
|
---|
| 121 | #define nb_photo_diodes 0 /* nb de canaux de mesure du senseur stellaire */
|
---|
| 122 | #endif
|
---|
| 123 |
|
---|
| 124 |
|
---|
| 125 | #ifdef _sans_transputer
|
---|
| 126 | #define nb_byte_mot 5 /* nombre d'octets dans un mot d'acquisition planck */
|
---|
| 127 | #else
|
---|
| 128 | #define nb_byte_mot 8 /* nombre d'octets dans un mot d'acquisition archeops */
|
---|
| 129 | #endif
|
---|
| 130 |
|
---|
[643] | 131 | #define nb_max_nom_bolo 24 /* nombre maxi de noms et coef bolo dans la table */
|
---|
| 132 |
|
---|
[639] | 133 | #define nb_sync 4 /* nombre de signaux de synchro */
|
---|
| 134 | /* 6 pour diabolo */
|
---|
| 135 | /* toujours multiple de 4 pour archeops */
|
---|
[637] | 136 | #define nb_element_catalog 256 /* nombre d'éléments catalog par reponse enregistreur */
|
---|
| 137 |
|
---|
| 138 |
|
---|
| 139 | #ifdef transmet_data_brute
|
---|
| 140 | #define taille_maxi_block_archeops sizeof(block_type_data_brute)
|
---|
| 141 | #else /* le plus gros des différents blocks de télémesure*/
|
---|
| 142 | #define taille_maxi_block_archeops sizeof(block_type_bolo)
|
---|
| 143 | #endif
|
---|
| 144 |
|
---|
| 145 | #define nombre_de_regul 4
|
---|
| 146 | #define nombre_de_voies 6
|
---|
| 147 | #define nb_type_blocks 20 /* nombre de type de blocks (multiple de 4) */
|
---|
[643] | 148 | #define nb_modes_telemesure 10
|
---|
| 149 | #define nb_modes_flash 3
|
---|
[637] | 150 |
|
---|
| 151 | /*======================================================================*/
|
---|
| 152 | /* ------- codes de controle pour la transmission ----- */
|
---|
| 153 | /*======================= télécommande ==========================*/
|
---|
| 154 | /*======================================================================*/
|
---|
| 155 |
|
---|
| 156 |
|
---|
| 157 | /* -------------- codes de reconnaissance des paquets de télécommande -------------- */
|
---|
| 158 |
|
---|
| 159 | #define debut_telecommande 0x23456789
|
---|
| 160 | #define fin_telecommande 0x98765432
|
---|
| 161 |
|
---|
| 162 | /* ------------ codes de direction des commandes envoyées a l'EPLD Archeops -------------- */
|
---|
| 163 |
|
---|
| 164 | #define tc_dir_transputer 1
|
---|
| 165 | #define tc_dir_reset_epld 3
|
---|
| 166 |
|
---|
| 167 | /* ------------- codes des prefix des telecommandes traités le transputer -------------- */
|
---|
| 168 |
|
---|
| 169 | #define tc_horloge 255 /* (-1) */
|
---|
| 170 | #define tc_cadence1 128
|
---|
| 171 | #define tc_cadence2 129
|
---|
| 172 | #define tc_cadence3 130
|
---|
| 173 | #define tc_regul 251 /* (-5) */
|
---|
| 174 | #define tc_switch_dil 250
|
---|
| 175 | #define tc_dac_dil 249
|
---|
| 176 |
|
---|
| 177 | /*======================================================================*/
|
---|
| 178 | /* telecommande reduite sur 18 bit */
|
---|
| 179 | /*======================================================================*/
|
---|
| 180 |
|
---|
| 181 | /*______________________________________________________________________________________________*/
|
---|
| 182 | /* 1er mot : code de debut de telecommande reduite */
|
---|
| 183 | #define tc_reduite 248
|
---|
| 184 | /*______________________________________________________________________________________________*/
|
---|
| 185 | /* 2eme mot: 4bit: 16 codes de direction tc2 */
|
---|
| 186 | enum{tc2_reset_epld,tc2_bolo_dacV,tc2_bolo_dacI,tc2_bolo_dacT
|
---|
| 187 | ,tc2_bolo_dacL,tc2_bolo_gain,tc2_bolo_voie,tc2_horloge
|
---|
[639] | 188 | ,tc2_regul,tc2_auto_bolo,tc2_auto_dilu,tc2_dilution}; /* 12 codes: reste 4 disponibles*/
|
---|
[637] | 189 |
|
---|
| 190 |
|
---|
| 191 | /*______________________________________________________________________________________________*/
|
---|
| 192 | /* 3eme mot: 6bit: */
|
---|
| 193 |
|
---|
| 194 | /* code2=dac-gain-voie : numero de bolo */
|
---|
| 195 |
|
---|
| 196 | /* code2=tc2_horloge : */
|
---|
| 197 | /* soit un code defini */
|
---|
| 198 | /* soit le code tc3_vitesse+i avec i=0.. nb_type_block */
|
---|
[639] | 199 | enum{tc3_commande,tc3_periode,tc3_nb_mesures,tc3_temp_mort,tc3_flag,tc3_vitesse};
|
---|
| 200 | /*#define tc3_suite tc3_vitesse+nb_type_block */
|
---|
[637] | 201 |
|
---|
| 202 |
|
---|
| 203 | /* code2=tc2_regul : */
|
---|
| 204 |
|
---|
| 205 |
|
---|
| 206 | /* code2=tc2_auto_bolo : */
|
---|
| 207 |
|
---|
| 208 |
|
---|
| 209 | /* code2=tc2_auto_dilu : */
|
---|
| 210 | /* les valeurs des parametres d'auto_dilu ne depassent pas 128 */
|
---|
| 211 |
|
---|
| 212 |
|
---|
| 213 | /* code2=tc2_dilution : */
|
---|
| 214 |
|
---|
| 215 |
|
---|
| 216 | /*______________________________________________________________________________*/
|
---|
| 217 | /* 4eme mot: 8bit: valeur a ecrire */
|
---|
| 218 |
|
---|
| 219 |
|
---|
| 220 | /*======================================================================*/
|
---|
| 221 | /* ------- codes de controle pour la transmission ----- */
|
---|
| 222 | /*========================= télémesure ============================*/
|
---|
| 223 | /*======================================================================*/
|
---|
| 224 |
|
---|
| 225 | /* ------- codes de reconnaissance des paquets de télémesure */
|
---|
| 226 |
|
---|
[643] | 227 | #define debut_block_mesure 0x45627491
|
---|
| 228 | #define fin_block_mesure 0x83260432
|
---|
[637] | 229 |
|
---|
| 230 |
|
---|
| 231 |
|
---|
| 232 |
|
---|
| 233 |
|
---|
| 234 | /*======================================================================*/
|
---|
| 235 | /* ------------------------------------------------------------------ */
|
---|
| 236 | /* --------- Les formats des blocks type ARCHEOPS ------- */
|
---|
| 237 | /* ------------------------------------------------------------------ */
|
---|
| 238 | /*======================================================================*/
|
---|
| 239 |
|
---|
| 240 |
|
---|
| 241 |
|
---|
| 242 | /*==============================================================================================*/
|
---|
| 243 |
|
---|
| 244 | /* Le tableau est lut dans le desordre par le mac en lecture de la carte pci : */
|
---|
| 245 |
|
---|
| 246 | /* Les entiers long sont ecrits tels quels */
|
---|
| 247 | /* Les short sont ecrits permuté 2 a 2 par le tansputer */
|
---|
| 248 | /* Les tables char sont ecrits permuté 4 / 4 par le transputer */
|
---|
| 249 | /* A la lecture dans le mac, tout est bon */
|
---|
| 250 |
|
---|
| 251 |
|
---|
| 252 | /* --------- structures N° 0 : parametres de mesure des bolometres ------------- */
|
---|
| 253 | /* ----------------------------------------------------------------------------------------- */
|
---|
| 254 |
|
---|
| 255 | typedef struct
|
---|
| 256 | {
|
---|
[643] | 257 | int4 numero_nom_coef; /* le numero pour retrouver le nom et les coef */
|
---|
[639] | 258 | int4 bolo_code_util; /* le code d'utilisation du bolo */
|
---|
[643] | 259 | int4 bolo_bebo; /* l'acquisition: 0 pour MLPA 10 pour BEBODIFF*/
|
---|
[639] | 260 | int4 bolo_num; /* l'adresse hard du bolo */
|
---|
| 261 | int4 bolo_gain; /* le gain du preampli */
|
---|
| 262 | int4 bolo_capa; /* la valeur capa du modulateur */
|
---|
| 263 | int4 bolo_diviseur; /* le diviseur de la compensation */
|
---|
[643] | 264 | }
|
---|
| 265 | param_un_bolo;
|
---|
| 266 |
|
---|
| 267 |
|
---|
| 268 | typedef struct
|
---|
| 269 | {
|
---|
| 270 | char bolo_nom[32]; /* le nom de chaque bolometre */
|
---|
[639] | 271 | int4 coef[7]; /* les coef pour le calcul de la température */
|
---|
[637] | 272 | }
|
---|
[643] | 273 | nom_et_coef_bolo;
|
---|
| 274 |
|
---|
| 275 |
|
---|
| 276 |
|
---|
[637] | 277 | /* code_util des bolos */
|
---|
| 278 | enum{bolo_hors_service,bolo_normal_transmis,bolo_normal_non_transmis,bolo_thermo_simplifie};
|
---|
| 279 |
|
---|
| 280 |
|
---|
| 281 | typedef struct /* table des parametres de mesure bolometre */
|
---|
| 282 | /* cette table ne change pas (en principe) en cours de mesure */
|
---|
| 283 | {
|
---|
[639] | 284 | int4 numero_version; /* numero de version du header archeops.h */
|
---|
| 285 | int4 n_max_bolo; /* nombre maxi de bolos (divisible par 4) */
|
---|
| 286 | int4 n_per_block; /* nombre de periodes entieres dans un block */
|
---|
| 287 | int4 n_max_mes_per; /* nb de points maxi dans une periode complete */
|
---|
[637] | 288 |
|
---|
[639] | 289 | int4 nb_bolo; /* nombre de bolometres effectivement lut */
|
---|
[637] | 290 | param_un_bolo bolo[nb_max_bolo];
|
---|
[643] | 291 | nom_et_coef_bolo nom_coef[nb_max_nom_bolo]; /* nombre de nom et coef bolo */
|
---|
[637] | 292 | }
|
---|
| 293 | param_bolo;
|
---|
| 294 |
|
---|
| 295 |
|
---|
| 296 |
|
---|
| 297 |
|
---|
| 298 | /*
|
---|
[643] | 299 | int4 bolo_code_util[nb_max_bolo];
|
---|
[637] | 300 | char bolo_nom[nb_max_bolo][32];
|
---|
| 301 |
|
---|
[643] | 302 | int4 bolo_bebo[nb_max_bolo];
|
---|
| 303 | int4 bolo_num[nb_max_bolo];
|
---|
| 304 | int4 bolo_gain[nb_max_bolo];
|
---|
[637] | 305 |
|
---|
[643] | 306 | int4 bolo_capa[nb_max_bolo];
|
---|
| 307 | int4 bolo_diviseur[nb_max_bolo];
|
---|
[637] | 308 |
|
---|
[643] | 309 | int4 coef[nb_max_bolo][7];
|
---|
[637] | 310 |
|
---|
[643] | 311 | int4 presence_bebo;
|
---|
[637] | 312 | }
|
---|
| 313 | param_bolo;
|
---|
| 314 | */
|
---|
| 315 |
|
---|
| 316 | typedef struct /* La structure de transfert transputer vers mac */
|
---|
| 317 | {
|
---|
[639] | 318 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 319 | int4 code1; /* code1 du block */
|
---|
| 320 | int4 code2; /* code2 du block */
|
---|
[637] | 321 |
|
---|
| 322 | param_bolo param; /* les parametres de mesure des bolometres */
|
---|
| 323 |
|
---|
[639] | 324 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 325 | }
|
---|
| 326 | block_type_param;
|
---|
| 327 |
|
---|
| 328 |
|
---|
| 329 |
|
---|
| 330 |
|
---|
| 331 | /* ------------------- structures N° 1 : journal de bord --------------------- */
|
---|
| 332 | /* ----------------------------------------------------------------------------------------- */
|
---|
| 333 | #define long_page 10
|
---|
| 334 | typedef struct
|
---|
| 335 | {
|
---|
[639] | 336 | int4 code2; /* code de la ligne du journal */
|
---|
[637] | 337 | /* code idem code2 debut de block : */
|
---|
| 338 | /* contient un code de commande */
|
---|
| 339 | /* et le numero du block lors de la télécommande */
|
---|
| 340 | char mot[8]; /* contenu de la ligne du journal */
|
---|
| 341 | }
|
---|
| 342 | ligne_journal;
|
---|
| 343 |
|
---|
| 344 |
|
---|
| 345 | typedef struct
|
---|
| 346 | {
|
---|
[639] | 347 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 348 | int4 code1; /* code1 du block */
|
---|
| 349 | int4 code2; /* code2 du block */
|
---|
[637] | 350 |
|
---|
| 351 | ligne_journal jj[long_page]; /* block de 10 lignes de journal */
|
---|
| 352 |
|
---|
[639] | 353 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 354 | }
|
---|
| 355 | block_type_journal;
|
---|
| 356 |
|
---|
| 357 |
|
---|
| 358 | /* --------- structures N° 2 : reglage_bolo , regul etc.. -------- */
|
---|
| 359 | /* ------------------------------------------------------------------------------------------ */
|
---|
| 360 | #define bol_micro_volt(val,gain) ((1e7*(double)val)/(65536.*gain))
|
---|
[639] | 361 | /* avec gain = (double)parametr.bolo[bolo].bolo_gain*gain_ampli(reglage.bolo[bolo]) */
|
---|
[637] | 362 |
|
---|
| 363 |
|
---|
| 364 | /* gains 0 .. 15 pour MLPA /// gain 16..19 pour BEBO /// gain 20..22 pour BEDIF */
|
---|
| 365 | #define def_gains double gains_reels[32]={1,2,4,8,10,20,40,80,100,200,400,800,1000,2000,4000,8000,0.5,2.5,10,50,0.93,3.777,18.974};
|
---|
| 366 | /* gain bediff 10->9.3 40->37.77 200->189.74 */
|
---|
| 367 |
|
---|
| 368 |
|
---|
| 369 | /* les definitions suivantes s'appliquent a une variable de type reglage.bolo[bol] */
|
---|
| 370 | #define gainbrut(aa) ((char)(((aa).mot1&0x1f)))
|
---|
| 371 | #define gain_ampli(aa) gains_reels[gainbrut(aa)]
|
---|
| 372 | #define phase(aa) ((char)(((aa).mot1&0x60)>>5))
|
---|
| 373 | #define comm(aa) ((char)(((aa).mot1&0x80)>>7))
|
---|
| 374 | #define dac_V(aa) ((int)(((aa).mot1&0xfff00)>>8) )
|
---|
| 375 | #define dac_I(aa) ((int)(((aa).mot1&0xfff00000)>>20))
|
---|
| 376 |
|
---|
| 377 | #define voie(aa) ((char)(((aa).mot2&0xff)))
|
---|
| 378 | #define dac_T(aa) ((int)(((aa).mot2&0xfff00)>>8))
|
---|
| 379 | #define dac_L(aa) ((int)(((aa).mot2&0xfff00000)>>20))
|
---|
| 380 |
|
---|
| 381 | /*
|
---|
| 382 | #define bolo_mot1(dacV,dacI,gainbrut,phase,comm) ((gainbrut)&0x1f) | (((phase)&3)<<5) | (((comm)&1)<<7) | (((dacV)&0xfff)<<8) | (((dacI)&0xfff)<<20)
|
---|
| 383 | #define bolo_mot2(dacT,dacL,voie) ((voie)&0xff) | (((dacT)&0xfff)<<8) | (((dacL)&0xfff)<<20)
|
---|
| 384 | */
|
---|
| 385 |
|
---|
| 386 | #define bolo_mot1(dacV,dacI,gainbrut,phase,comm) (((long)(gainbrut))&0x1f) | ((((long)(phase))&3)<<5) | ((((long)(comm))&1)<<7) | ((((long)(dacV))&0xfff)<<8) | ((((long)(dacI))&0xfff)<<20)
|
---|
| 387 | #define bolo_mot2(dacT,dacL,voie) (((long)(voie))&0xff) | ((((long)(dacT))&0xfff)<<8) | ((((long)(dacL))&0xfff)<<20)
|
---|
| 388 |
|
---|
| 389 |
|
---|
| 390 | typedef struct
|
---|
| 391 | {
|
---|
[639] | 392 | int4 mot1; /* dac1 = mot[11..0]; dac2=mot1[23..12] */
|
---|
[637] | 393 | /* gain = mot1[27..24]; phase = mot1[31..28]; */
|
---|
[639] | 394 | int4 mot2; /* dac3 = mot[11..0]; dac4=mot1[23..12] */
|
---|
[637] | 395 | /* voie pour reglages auto = mot2[31..24]; */
|
---|
| 396 | }
|
---|
| 397 | reglage_un_bolo;
|
---|
| 398 |
|
---|
| 399 |
|
---|
| 400 |
|
---|
| 401 | #ifdef programme /*********** structure normale pour le mac ****************/
|
---|
| 402 |
|
---|
| 403 | typedef struct
|
---|
| 404 | {
|
---|
| 405 | char periode;
|
---|
| 406 | char nb_mesures;
|
---|
| 407 | char temp_mort;
|
---|
| 408 | char flag;
|
---|
| 409 | }
|
---|
| 410 | horloge;
|
---|
| 411 |
|
---|
| 412 | typedef struct
|
---|
| 413 | {
|
---|
| 414 | char mode; /* on_off et deglitch */
|
---|
| 415 | char num_bolo; /* numero du bolo utilisé, */
|
---|
| 416 | char voie_chauf; /* la voie de sortie chauffage */
|
---|
| 417 | char prop; /* zero dans prop -> chauffage=0; */
|
---|
| 418 | char integ;
|
---|
| 419 | char deriv;
|
---|
| 420 | short chauffage; /* valeur effective du chauffage */
|
---|
| 421 | }
|
---|
[643] | 422 | regul_bolo; /* longueur 2 entiers int4 */
|
---|
[637] | 423 |
|
---|
| 424 | typedef struct
|
---|
| 425 | {
|
---|
| 426 | char mode;
|
---|
| 427 | char gain;
|
---|
| 428 | char courant;
|
---|
| 429 | char delai;
|
---|
| 430 | }
|
---|
[643] | 431 | auto_bolo; /* longueur 1 entiers int4 */
|
---|
[637] | 432 |
|
---|
| 433 | typedef struct
|
---|
| 434 | {
|
---|
| 435 | char vanne;
|
---|
| 436 | char helium;
|
---|
| 437 | char chauffage;
|
---|
| 438 | char piles;
|
---|
| 439 | char transmission;
|
---|
| 440 | char temps_max_vanne;
|
---|
| 441 | char xx7;
|
---|
| 442 | char xx8;
|
---|
| 443 | }
|
---|
[643] | 444 | auto_dilu; /* longueur 1 entiers int4 */
|
---|
[637] | 445 |
|
---|
| 446 |
|
---|
| 447 |
|
---|
| 448 | #else /*********** structure swappée pour le transputer ****************/
|
---|
| 449 |
|
---|
| 450 | typedef struct
|
---|
| 451 | {
|
---|
| 452 | char flag;
|
---|
| 453 | char temp_mort;
|
---|
| 454 | char nb_mesures;
|
---|
| 455 | char periode;
|
---|
| 456 | }
|
---|
| 457 | horloge;
|
---|
| 458 |
|
---|
| 459 |
|
---|
| 460 | typedef struct
|
---|
| 461 | {
|
---|
| 462 | char prop; /* zero dans prop -> chauffage=0; */
|
---|
| 463 | char voie_chauf; /* la voie de sortie chauffage */
|
---|
| 464 | char num_bolo; /* numero du bolo utilisé, */
|
---|
| 465 | char mode; /* on_off et deglitch */
|
---|
| 466 | short chauffage; /* valeur effective du chauffage */
|
---|
| 467 | char deriv;
|
---|
| 468 | char integ;
|
---|
| 469 | }
|
---|
[643] | 470 | regul_bolo; /* longueur 2 entiers int4 */
|
---|
[637] | 471 |
|
---|
| 472 |
|
---|
| 473 | typedef struct
|
---|
| 474 | {
|
---|
| 475 | char delai;
|
---|
| 476 | char courant;
|
---|
| 477 | char gain;
|
---|
| 478 | char mode;
|
---|
| 479 | }
|
---|
[643] | 480 | auto_bolo; /* longueur 1 entiers int4 */
|
---|
[637] | 481 |
|
---|
| 482 | typedef struct
|
---|
| 483 | {
|
---|
| 484 | char piles;
|
---|
| 485 | char chauffage;
|
---|
| 486 | char helium; /* periode de mesure */
|
---|
| 487 | char vanne;
|
---|
| 488 | char xx8;
|
---|
| 489 | char xx7;
|
---|
| 490 | char temps_max_vanne;
|
---|
| 491 | char transmission;
|
---|
| 492 | }
|
---|
[643] | 493 | auto_dilu; /* longueur 1 entiers int4 */
|
---|
[637] | 494 |
|
---|
| 495 |
|
---|
| 496 | #endif /*********** fin des structures swappées ****************/
|
---|
| 497 |
|
---|
| 498 | enum{regul_stop,regul_chauffage_null,regul_sans_deglitch,regul_avec_deglitch};
|
---|
| 499 |
|
---|
| 500 | #define bit_piles_5V 1
|
---|
| 501 | #define bit_piles_15V 2
|
---|
| 502 | #define bit_piles_auto 4
|
---|
| 503 |
|
---|
[643] | 504 | enum{vanne_zero,vanne_rien,vanne_ferme,vanne_ouvre,vanne_auto_pression,vanne_auto_P_T};
|
---|
| 505 | /*enum{trans_zero,trans_rien,trans_normal,trans_rapide,trans_lent};*/
|
---|
[639] | 506 | enum{helium_zero,helium_continu,helium_40s,helium_400s};
|
---|
[637] | 507 |
|
---|
| 508 |
|
---|
[643] | 509 | typedef struct /* int4 en mot de 32 bit */
|
---|
[637] | 510 | {
|
---|
| 511 | horloge horloge; /* 1 */
|
---|
| 512 | reglage_un_bolo bolo[nb_max_bolo]; /* 18 * 2 = 36 */
|
---|
| 513 | auto_bolo autom[nombre_de_voies]; /* 6 * 1 6 */
|
---|
| 514 | regul_bolo regul[nombre_de_regul]; /* 4 * 2 = 8 */
|
---|
| 515 | auto_dilu dilu; /* 2 */
|
---|
| 516 | }
|
---|
| 517 | reglage_bolo; /* total 58 */
|
---|
| 518 |
|
---|
| 519 |
|
---|
| 520 | typedef struct
|
---|
| 521 | {
|
---|
[639] | 522 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 523 | int4 code1; /* code1 du block */
|
---|
| 524 | int4 code2; /* code2 du block */
|
---|
[637] | 525 | reglage_bolo reglage;
|
---|
[639] | 526 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 527 | }
|
---|
| 528 | block_type_reglage;
|
---|
| 529 |
|
---|
| 530 | /* --------------------- structures N° 3 : etat de la dilution ----------------------- */
|
---|
| 531 | /* ------------------------------------------------------------------------------------------- */
|
---|
| 532 | typedef struct
|
---|
| 533 | {
|
---|
[639] | 534 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 535 | int4 code1; /* code1 du block */
|
---|
| 536 | int4 code2; /* code2 du block */
|
---|
| 537 | int4 switch_dil;
|
---|
| 538 | int4 ADC_dil[48]; /* la lecture des 48 ADC de la carte DIL */
|
---|
| 539 | int4 DAC_dil[4]; /* les 4 dac de la carte dilution */
|
---|
| 540 | int4 DAC_sst[4]; /* les 4 dac de la carte sst */
|
---|
| 541 | int4 temperature[4]; /* valeurs lues sur cartes BEDIFF modifiees */
|
---|
| 542 | /* int4 gyro_dil[3][nb_per_block*2]; les gyros (block gyros) */
|
---|
| 543 | /* int4 data_dil[50]; data brutes de la dilution */
|
---|
| 544 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 545 | }
|
---|
| 546 | block_type_dilution;
|
---|
| 547 |
|
---|
| 548 |
|
---|
| 549 | /* signification des bit lus dans switch_dil */
|
---|
| 550 | #define switch_EVF 0x00000080 /* contact fin de course vanne fermee */
|
---|
| 551 | #define switch_EVO 0x00000040 /* contact fin de course vanne ouverte */
|
---|
| 552 |
|
---|
| 553 | /* les bit suivants sont envoyés par telecommande et relus dans switch_dil */
|
---|
| 554 | #define switch_helium 0x00200000 /* 13: commande sond niveau helium */
|
---|
| 555 | #define switch_pile_par_5 0x00100000 /* 12: mise en parallele des piles pour le 5V */
|
---|
| 556 | #define switch_pile_par_15 0x00080000 /* 11: mise en parallele des piles pour le 15V */
|
---|
| 557 | #define vanne_EVB 0x00008000 /* 7: commande vanne brooks */
|
---|
| 558 | #define vanne_EVO 0x00010000 /* 8: commande vanne EVO */
|
---|
| 559 | #define vanne_EVV 0x00020000 /* 9: commande vanne EVV */
|
---|
| 560 | #define vanne_EVF 0x00040000 /* 10: commande vanne EVF */
|
---|
| 561 | #define chauffage1 0x00004000 /* 6: chauffage 1 */
|
---|
| 562 | #define chauffage2 0x00002000 /* 6: chauffage 1 */
|
---|
| 563 | #define chauffage3 0x00001000 /* 6: chauffage 1 */
|
---|
| 564 | #define chauffage4 0x00000800 /* 6: chauffage 1 */
|
---|
| 565 | #define chauffage5 0x00000400 /* 6: chauffage 1 */
|
---|
| 566 | #define chauffage6 0x00000200 /* 6: chauffage 1 */
|
---|
| 567 | #define chauffage7 0x00000100 /* 0: chauffage 7 */
|
---|
| 568 |
|
---|
| 569 | /* position des mesures sur les multiplexeurs */
|
---|
[639] | 570 | /* J10A -> temperatures basses t_b1 t_b2,t_b3 t_b4 36 37 41 35 */
|
---|
| 571 | /* J10B -> temperatures basses t_a1 t_a2,t_a3 t_a4 38 11 34 28 */
|
---|
| 572 | /* J1?? -> temperatures hautes t_h1 t_h2,t_h3 t_h4 */
|
---|
[637] | 573 |
|
---|
| 574 | enum{
|
---|
[639] | 575 | /* multiplex11..18:*/ t_a2 ,mul12_ ,p_haut ,p_memb ,t_h1 ,t_h4 ,t_h3 ,t_h2
|
---|
| 576 | /* multiplex21..28:*/, mul21_ ,mul22 ,p_charb,p_R4 ,mul25_ ,p_C3 ,p_R3 ,t_a4
|
---|
| 577 | /* multiplex31..38:*/, mul31_ ,p_C4 ,p_air ,t_a3 ,t_b4 ,t_b1 ,t_b2 ,t_a1
|
---|
[637] | 578 | /* multiplex41..48:*/, t_b3 ,d_4He ,RP_He ,mul44 ,d_3He ,j_he3 ,j_he7 ,j_he4
|
---|
| 579 | /* multiplex51..58:*/, j_he5 ,j_he1 ,j_he8 ,j_he2 ,j_he6 ,pirani ,mul57 ,mul58
|
---|
| 580 | /* multiplex61..68:*/, p_m18B ,p_10B ,p_m18D ,mul64 ,p_p18B ,p_10T ,p_Ch ,p_p18D
|
---|
| 581 | };
|
---|
[639] | 582 | /* reste libres : mul 12 - 21 - 22 - 25 - 31 - 44 - 57 - 58 - 64 */
|
---|
[637] | 583 |
|
---|
[643] | 584 | #define val_multiplex(qq) (0.0003052*(double)((qq)-0x8000))
|
---|
| 585 | #define val_temperature(qq) ((val_multiplex(qq)<0.2)?-99:((1146.3/(val_multiplex(qq)-0.1)) - 245.13))
|
---|
[637] | 586 |
|
---|
| 587 |
|
---|
| 588 | /* --------------------- structures N° 4 : gps ------------------------------- */
|
---|
| 589 | /* ------------------------------------------------------------------------------------------- */
|
---|
| 590 |
|
---|
| 591 | typedef struct
|
---|
| 592 | {
|
---|
[639] | 593 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 594 | int4 code1; /* code1 du block */
|
---|
| 595 | int4 code2; /* code2 du block */
|
---|
[637] | 596 |
|
---|
| 597 | char gps[80]; /* les données GPS (une chaine maxi 80 cara) */
|
---|
| 598 |
|
---|
[639] | 599 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 600 | }
|
---|
| 601 | block_type_gps;
|
---|
| 602 |
|
---|
| 603 |
|
---|
| 604 |
|
---|
| 605 | /* --------------------- structures N° 5 : tous les bolos 1 periode --------------- */
|
---|
| 606 | /* ------------------------------------------------------------------------------------------- */
|
---|
| 607 | typedef struct
|
---|
| 608 | {
|
---|
[639] | 609 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 610 | int4 code1; /* code1 du block */
|
---|
| 611 | int4 code2; /* code2 du block */
|
---|
[637] | 612 |
|
---|
| 613 | short bol_per[nb_max_bolo][nb_max_mes_per];
|
---|
| 614 |
|
---|
[639] | 615 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 616 | }
|
---|
| 617 | block_type_une_periode;
|
---|
| 618 |
|
---|
| 619 | /* ---------------- structures N° 6 : signals de synchro (pour test au sol) --------------- */
|
---|
| 620 | /* ------------------------------------------------------------------------------------------- */
|
---|
| 621 | typedef struct
|
---|
| 622 | {
|
---|
[639] | 623 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 624 | int4 code1; /* code1 du block */
|
---|
| 625 | int4 code2; /* code2 du block */
|
---|
| 626 | char synchro[nb_per_block*2][nb_sync];
|
---|
[637] | 627 |
|
---|
[639] | 628 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 629 | }
|
---|
| 630 | block_type_synchro_sol;
|
---|
| 631 |
|
---|
| 632 | /* --------------------- structures N° 7 : block de données de pointage sol ----------- */
|
---|
| 633 | /* ------------------------------------------------------------------------------------------- */
|
---|
| 634 | typedef struct
|
---|
| 635 | {
|
---|
[639] | 636 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 637 | int4 code1; /* code1 du block */
|
---|
| 638 | int4 code2; /* code2 du block */
|
---|
[637] | 639 | char comment[1024];
|
---|
[639] | 640 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 641 | }
|
---|
| 642 | block_type_pointage_sol;
|
---|
| 643 |
|
---|
| 644 |
|
---|
| 645 |
|
---|
| 646 | /* ------------- structures N° 8 : données brutes des bolometres ---------------------- */
|
---|
| 647 | /* ------------------------------------------------------------------------------------------- */
|
---|
| 648 | typedef struct
|
---|
| 649 | {
|
---|
[639] | 650 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 651 | int4 code1; /* code1 du block */
|
---|
| 652 | int4 code2; /* code2 du block */
|
---|
[637] | 653 | /* pour chaque bolo, un vecteur 72 points */
|
---|
[639] | 654 | int4 data_bolo[nb_max_bolo][nb_per_block*2];
|
---|
[637] | 655 | /* data D.S. (en mots de 32 bits) */
|
---|
[639] | 656 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 657 | }
|
---|
| 658 | block_type_bolo;
|
---|
| 659 |
|
---|
| 660 | /* --------------------- structures N° 9 : données des gyroscopes et du magnétometre */
|
---|
| 661 | /* ----------------------------------------------------------------------------------------- */
|
---|
| 662 | typedef struct
|
---|
| 663 | {
|
---|
[639] | 664 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 665 | int4 code1; /* code1 du block */
|
---|
| 666 | int4 code2; /* code2 du block */
|
---|
[637] | 667 | /* chaque gyro: un vecteur tde 72 valeurs */
|
---|
[643] | 668 | int4 gyro[3][nb_per_block*2];
|
---|
[639] | 669 | int4 magneto[3]; /* 1 bit par echantillonage soit 3*32bit>72 */
|
---|
| 670 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 671 | }
|
---|
| 672 | block_type_gyro;
|
---|
| 673 |
|
---|
| 674 | /* --------------------- structures N° 10 : données senseur stellaire ----------- */
|
---|
| 675 | /* ----------------------------------------------------------------------------------------- */
|
---|
| 676 | typedef struct
|
---|
| 677 | {
|
---|
[639] | 678 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 679 | int4 code1; /* code1 du block */
|
---|
| 680 | int4 code2; /* code2 du block */
|
---|
| 681 | int4 sst[nb_per_block*2][18];
|
---|
[637] | 682 | /* chaque mesure: un paquet de 18 mots de 32 bits */
|
---|
[639] | 683 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 684 | }
|
---|
| 685 | block_type_sst;
|
---|
| 686 |
|
---|
| 687 | /* --------------------- structures N° 11 : rien ----------- */
|
---|
| 688 | /* ----------------------------------------------------------------------------------------- */
|
---|
| 689 | typedef struct
|
---|
| 690 | {
|
---|
[639] | 691 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 692 | int4 code1; /* code1 du block */
|
---|
| 693 | int4 code2; /* code2 du block */
|
---|
| 694 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 695 | }
|
---|
| 696 | block_type11;
|
---|
| 697 |
|
---|
| 698 | /* --------------------- structures N° 12 : data bolo apres compression sur 7 bit ------ */
|
---|
| 699 | /* ------------------------------------------------------------------------------------------- */
|
---|
| 700 | typedef struct
|
---|
| 701 | {
|
---|
[639] | 702 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 703 | int4 code1; /* code1 du block */
|
---|
| 704 | int4 code2; /* code2 du block */
|
---|
[637] | 705 | /* nombre de mots = nb valeurs/4 +1 */
|
---|
| 706 | /* pour chaque bolo, un vecteur 19 mots */
|
---|
[639] | 707 | unsigned int4 data_bolo[nb_bolo_util][ (nb_per_block/2) +1 ];
|
---|
[637] | 708 |
|
---|
[639] | 709 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 710 | }
|
---|
| 711 | block_type_bolo_comprime;
|
---|
| 712 |
|
---|
| 713 | /* --------------------- structures N° 13 : block_type_gyro_comprime ----------- */
|
---|
| 714 | /* ----------------------------------------------------------------------------------------- */
|
---|
| 715 | typedef struct
|
---|
| 716 | {
|
---|
[639] | 717 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 718 | int4 code1; /* code1 du block */
|
---|
| 719 | int4 code2; /* code2 du block */
|
---|
[637] | 720 | /* nombre de mots = nb valeurs/4 +1 */
|
---|
[639] | 721 | unsigned int4 gyro[3][ (nb_per_block/2) +1 ];
|
---|
| 722 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 723 | }
|
---|
| 724 | block_type_gyro_comprime;
|
---|
| 725 |
|
---|
| 726 | /* --------------------- structures N° 14 : block_type_sst_comprime ----------- */
|
---|
| 727 | /* ----------------------------------------------------------------------------------------- */
|
---|
| 728 | typedef struct
|
---|
| 729 | {
|
---|
[639] | 730 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 731 | int4 code1; /* code1 du block */
|
---|
| 732 | int4 code2; /* code2 du block */
|
---|
[637] | 733 | /* pour chaque diode, un vecteur 11 mots */
|
---|
[639] | 734 | unsigned int4 sst[nb_photo_diodes] [(nb_per_block*2/7) +1 ];
|
---|
| 735 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 736 | }
|
---|
| 737 | block_type_sst_comprime;
|
---|
| 738 |
|
---|
| 739 |
|
---|
[643] | 740 | /* --------------------- structures N° 15 : block_type_status_flash -------*/
|
---|
| 741 | /* ---------------------------------------------------------------- */
|
---|
[637] | 742 |
|
---|
[643] | 743 | /*
|
---|
| 744 | ** Quelque soit la commande, l'enregistreur renvoie toujours le meme type
|
---|
| 745 | de bloc comprenant la commande, un mot d'erreur eventuel et le status.
|
---|
[637] | 746 |
|
---|
[643] | 747 | ** L'enregistreur ne prend jamais l'initiative d'envoyer un bloc de status
|
---|
| 748 | (sauf dans le cas ci-dessous).
|
---|
[637] | 749 |
|
---|
[643] | 750 | ** Au reset, le controleur est un peu lent a demarrer (quelques secondes).
|
---|
| 751 | Pour que tu puisse savoir quand il est pret, je propose de t'envoyer un
|
---|
| 752 | bloc de type "block_type_status_flash" des que je suis pret (comme si tu
|
---|
| 753 | avais envoye un bloc "block_type_cmd_flash" avec la commande
|
---|
| 754 | "FLASH_STATUS_REQUEST"
|
---|
[637] | 755 |
|
---|
[643] | 756 | */
|
---|
[637] | 757 |
|
---|
[643] | 758 | typedef struct {/* etat de l'enregistreur */
|
---|
| 759 | int4 nb_total_blocks ;
|
---|
| 760 | int4 memoire_libre ;
|
---|
| 761 | int4 nb_block_erreur ;
|
---|
| 762 | } status_flash;
|
---|
[637] | 763 |
|
---|
[643] | 764 | typedef struct {
|
---|
| 765 | unsigned int4 debut ;
|
---|
| 766 | unsigned int4 code1 ;
|
---|
| 767 | unsigned int4 code2 ;
|
---|
[637] | 768 |
|
---|
[643] | 769 | int4 commande; /* la commande a laquelle ce bloc repond */
|
---|
| 770 | int4 erreur ; /* Si la commande a induit une erreur */
|
---|
| 771 | status_flash status ; /* etat de l'enregistreur */
|
---|
| 772 | unsigned int4 fin ; /* code de reconnaissance de fin de block */
|
---|
| 773 | } block_type_status_flash ;
|
---|
[637] | 774 |
|
---|
[643] | 775 | /* --------------------- structures N° 16 : block_type_cmd_flash ---------*/
|
---|
| 776 | /* ------------------------------------------------------------------ */
|
---|
| 777 | typedef struct {
|
---|
| 778 | unsigned int4 debut ;
|
---|
| 779 | unsigned int4 code1 ;
|
---|
| 780 | unsigned int4 code2 ;
|
---|
| 781 |
|
---|
| 782 | int4 commande; /* type de commande a l'enregistreur flash */
|
---|
| 783 |
|
---|
| 784 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
| 785 | } block_type_cmd_flash;
|
---|
| 786 |
|
---|
| 787 | /* Commands from Transputer to Recorder */
|
---|
| 788 | enum {
|
---|
| 789 | FLASH_STATUS_REQUEST,
|
---|
| 790 | FLASH_EFFACE_TOUT1, FLASH_EFFACE_TOUT2, FLASH_EFFACE_TOUT3,
|
---|
| 791 | FLASH_EFFACE_UTIL1, FLASH_EFFACE_UTIL2, FLASH_EFFACE_UTIL3
|
---|
| 792 | } ;
|
---|
| 793 |
|
---|
| 794 | /* Errors from Recorder to Transputer.
|
---|
| 795 | Pending question: what to do in case of FLASH_ERASE_END_ERROR ?
|
---|
| 796 | */
|
---|
| 797 |
|
---|
| 798 | enum {
|
---|
| 799 | FLASH_STATUS_OK, /* Pas d'erreur */
|
---|
| 800 | FLASH_BAD_SEQUENCE, /* Mauvaise sequence d'effacement */
|
---|
| 801 | FLASH_ERASE_START, /* Debut d'effacement */
|
---|
| 802 | FLASH_ERASE_END_OK, /* Fin d'effacement OK */
|
---|
| 803 | FLASH_ERASE_END_ERROR /* Erreur pendant l'effacement */
|
---|
| 804 | } ;
|
---|
| 805 |
|
---|
| 806 |
|
---|
[637] | 807 | /* --------------------- structures N° 17 : block brut de données ctb pour test ------- */
|
---|
| 808 | /* ------------------------------------------------------------------------------------------- */
|
---|
| 809 | typedef struct
|
---|
| 810 | {
|
---|
[639] | 811 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 812 | int4 code1; /* code1 du block */
|
---|
| 813 | int4 code2; /* code2 du block */
|
---|
[637] | 814 | #ifdef transmet_data_brute
|
---|
| 815 | char data[nb_per_block*nb_max_mes_per*nb_byte_mot];
|
---|
| 816 | #endif
|
---|
[639] | 817 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 818 | }
|
---|
| 819 | block_type_data_brute;
|
---|
| 820 |
|
---|
| 821 | /* --------------------- structures N° 18 : block vide pour l'instant ------- */
|
---|
| 822 | /* ------------------------------------------------------------------------------------------- */
|
---|
| 823 | typedef struct
|
---|
| 824 | {
|
---|
[639] | 825 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 826 | int4 code1; /* code1 du block */
|
---|
| 827 | int4 code2; /* code2 du block */
|
---|
| 828 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 829 | }
|
---|
| 830 | block_type_18;
|
---|
| 831 |
|
---|
| 832 | /* --------------------- structures N° 19 : block vide pour l'instant ------- */
|
---|
| 833 | /* ------------------------------------------------------------------------------------------- */
|
---|
| 834 | typedef struct
|
---|
| 835 | {
|
---|
[639] | 836 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 837 | int4 code1; /* code1 du block */
|
---|
| 838 | int4 code2; /* code2 du block */
|
---|
| 839 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 840 | }
|
---|
| 841 | block_type_19;
|
---|
| 842 |
|
---|
| 843 |
|
---|
| 844 |
|
---|
| 845 | /* --------- block modele (plus gros que tous les autres pour reservation memoire) ---- */
|
---|
| 846 | /* ----------------------------------------------------------------------------------------- */
|
---|
| 847 |
|
---|
| 848 | typedef struct /* La structure de transfert transputer vers mac */
|
---|
| 849 | {
|
---|
[639] | 850 | int4 debut; /* code de reconnaissance de debut de block */
|
---|
| 851 | int4 code1; /* code1 du block */
|
---|
| 852 | int4 code2; /* code2 du block */
|
---|
| 853 | int4 mot[(taille_maxi_block_archeops)/4];
|
---|
| 854 | int4 fin; /* code de reconnaissance de fin de block */
|
---|
[637] | 855 | }
|
---|
| 856 | block_type_modele;
|
---|
| 857 |
|
---|
| 858 |
|
---|
| 859 |
|
---|
| 860 |
|
---|
| 861 |
|
---|
| 862 | /*==============================================================================================*/
|
---|
| 863 | /*==============================================================================================*/
|
---|
| 864 | /* -------------- définitions permettant de travailler sur les blocks Archeops ----------- */
|
---|
| 865 | /*==============================================================================================*/
|
---|
| 866 | /*==============================================================================================*/
|
---|
| 867 |
|
---|
| 868 |
|
---|
| 869 |
|
---|
| 870 | enum {block_param,block_journal,block_reglage,block_dilution,
|
---|
| 871 | block_gps,block_une_periode,block_synchro_sol,block_pointage_sol,
|
---|
| 872 | block_bolo,block_gyro,block_sst,block_11,
|
---|
[643] | 873 | block_bolo_comprime,block_gyro_comprime,block_sst_comprime,block_status_flash,
|
---|
[637] | 874 | block_cmd_flash,block_data_brute,block_18,block_19};
|
---|
| 875 |
|
---|
| 876 |
|
---|
| 877 | #define def_nom_block char nom_block[nb_type_blocks][32]={"block_param","block_journal","block_reglage","block_dilution",\
|
---|
| 878 | "block_gps","block_une_periode","block_synchro_sol","block_pointage_sol",\
|
---|
| 879 | "block_bolo","block_gyro","block_sst","block_11",\
|
---|
[643] | 880 | "block_bolo_comprime","block_gyro_comprime","block_sst_comprime","block_status_flash",\
|
---|
[637] | 881 | "block_cmd_flash","block_data_brute","",""};
|
---|
| 882 |
|
---|
| 883 |
|
---|
| 884 | #define def_long_block int long_block[nb_type_blocks]={sizeof(block_type_param),sizeof(block_type_journal),sizeof(block_type_reglage),sizeof(block_type_dilution),\
|
---|
| 885 | sizeof(block_type_gps),sizeof(block_type_une_periode),sizeof(block_type_synchro_sol),sizeof(block_type_pointage_sol),\
|
---|
| 886 | sizeof(block_type_bolo),sizeof(block_type_gyro),sizeof(block_type_sst),sizeof(block_type11),\
|
---|
[643] | 887 | sizeof(block_type_bolo_comprime),sizeof(block_type_gyro_comprime),sizeof(block_type_sst_comprime),sizeof(block_type_status_flash),\
|
---|
[637] | 888 | sizeof(block_type_cmd_flash),sizeof(block_type_data_brute),sizeof(block_type_18),sizeof(block_type_19)};
|
---|
| 889 |
|
---|
| 890 |
|
---|
| 891 |
|
---|
| 892 |
|
---|
| 893 |
|
---|
| 894 | /* le code du block contient 8 bit de type */
|
---|
| 895 | /* 24 bit pour le numero du block(horloge locale) */
|
---|
| 896 | /* 12 bit pour la longueur du block (en octet) */
|
---|
| 897 | /* 16 bit pour la somme de test de la validité du block */
|
---|
| 898 |
|
---|
| 899 | /* les define suivants doivent etre utilisés pour tester le type des blocks et les verifier */
|
---|
| 900 |
|
---|
| 901 |
|
---|
| 902 | #define longueur_block(_bk) ( (int) ((_bk)->code1>>16) & 0xffff )
|
---|
| 903 | #define somme_block(_bk) ( (int) (_bk)->code1 & 0xffff )
|
---|
| 904 |
|
---|
| 905 | #define type_block(_bk) ( (int) ((_bk)->code2>>24) & 0xff )
|
---|
| 906 | #define numero_block(_bk) ( (int) (_bk)->code2 & 0xffffff )
|
---|
| 907 |
|
---|
| 908 | /* ce define cree le mot de controle de somme des blocks et de les verifier a la reception */
|
---|
| 909 |
|
---|
| 910 |
|
---|
| 911 | /*==============================================================================================*/
|
---|
| 912 | /*==============================================================================================*/
|
---|
| 913 | /* ----------------- fonctions utilitaires de gestion des blocks Archeops ---------------- */
|
---|
| 914 | /*==============================================================================================*/
|
---|
| 915 | /*==============================================================================================*/
|
---|
| 916 |
|
---|
| 917 |
|
---|
| 918 | /* -------------------------------------------------------------------------------------------- */
|
---|
| 919 | /* les fonctions suivantes sont des utilitaires permettant la gestion des blocks archeops */
|
---|
| 920 | /* il faut inclure une seule fois le header archeops.h précéde de : */
|
---|
| 921 | /* #define utilitaires_de_block_archeops */
|
---|
| 922 | /* -------------------------------------------------------------------------------------------- */
|
---|
| 923 |
|
---|
| 924 |
|
---|
| 925 | /* ---------------------------- prototypes des fonctions ------------------------------ */
|
---|
| 926 | /* -------------------------------------------------------------------------------------------- */
|
---|
| 927 |
|
---|
| 928 |
|
---|
| 929 | /* cette fonction calcule le code de somme pour le controle de parité des blocks */
|
---|
| 930 |
|
---|
| 931 | int calcul_somme_block(block_type_modele* blk,int longueur);
|
---|
| 932 |
|
---|
| 933 |
|
---|
| 934 |
|
---|
| 935 |
|
---|
| 936 |
|
---|
| 937 | /* cette fonction est a apeller lors de la création d'un block apres l'avoir rempli */
|
---|
| 938 | /* elle permet de creer tous les mots de controle du block */
|
---|
| 939 |
|
---|
| 940 | void valide_block(block_type_modele* blk,int type,int block_num);
|
---|
| 941 |
|
---|
| 942 |
|
---|
| 943 |
|
---|
| 944 | /* cette fonction est a apeller pour vérifier la validité d'un block */
|
---|
| 945 | /* elle retourne 0 si le block est correct et sinon, un code d'erreur */
|
---|
| 946 | /* la seconde fonction sort les erreurs a l'ecran */
|
---|
| 947 |
|
---|
| 948 | int verifie_block(block_type_modele* blk);
|
---|
| 949 | int verifie_block_printf(block_type_modele* blk);
|
---|
| 950 |
|
---|
| 951 | enum {block_correct,block_type_inconnu,block_longueur_erreur,block_somme_erreur
|
---|
| 952 | ,block_debut_erreur,block_fin_erreur};
|
---|
| 953 |
|
---|
| 954 | /* cette fonction transforme un char (sur 8 bit) en double avec une echelle logarythmique */
|
---|
| 955 | /* elle est en particulier utilisée pour calculer les coef de la regul */
|
---|
| 956 |
|
---|
| 957 | double val_double(char x);
|
---|
| 958 |
|
---|
[643] | 959 | /* cette fonction transforme un char (sur 8 bit) en entier int4 (echelle logarythmique) */
|
---|
[637] | 960 | /* elle est en particulier utilisée pour fixer le courant sur les bolometres */
|
---|
| 961 |
|
---|
[643] | 962 | unsigned int4 val_long(char x);
|
---|
[637] | 963 |
|
---|
| 964 | int new_val_dac(int a,char code);
|
---|
| 965 |
|
---|
| 966 |
|
---|