source: Sophya/trunk/Poubelle/archediab.old/archeops.c@ 649

Last change on this file since 649 was 649, checked in by ansari, 26 years ago

archediab 28 vol

File size: 25.1 KB
RevLine 
[649]1
2
3#include "manip.h"
4
[637]5#include "archeops.h"
6
7
[639]8
[649]9/* sauve vol trapani 2eme config de vol */
[637]10
11
[649]12
13/********** coefficients pour les mesures bolo **********************************/
14
15/* toutes les puissances en pW */
16
17/* -1- loi de reponse thermique des bolos avec R en ohms et T en Kelvin */
18
19/* */
20
21/* T = coef2 * ( ln ( R / coef1) ** ( -1 / coef0 ) */
22
23/* */
24
25/* -2- fuite thermique du bolo coef 3,4 */
26
27/* */
28
29/* Ptot = coef3 * ( (10*Tb) ** coef4 - (10*Tcryo) ** coef4 ) */
30
31/* */
32
33/* -3- calcul empirique de Pciel et de tau coef 5,6 */
34
35/* */
36
37/* Pciel = coef5 - Pelec coef5= I * Ai (tables xavier) */
38
39/* tau = - ln ( 1 + Pciel / coef6 ) coef6= I * Bi (tables xavier) */
40
41/* */
42
43/* Pour les thermometres 1 à 4 (germanium et carbone Allan-Bradley) */
44
45/* les coefficients sont utilisés differemment, ils permettent de convertir */
46
47/* R vers T ( c(6) est un offset sur la mesure de R par rapport aux mesures 4 fils)*/
48
49/* llR= log(log(R - c(6))-c(0)) */
50
51/* T = exp(c(1) + c(2)* llR + c(3)* llR* llR + c(4)* llR* llR* llR + */
52
53/* c(5)* llR* llR* llR* llR) */
54
55/* */
56
57/* version vol Trapani */
58
59/* on corrige le biais de temperature coef2=1.1 old, coef3=old/1.1^coef4 */
60
61/* */
62
63/* */
64
65/* */
66
67/* */
68
69/* */
70
71/****************************************************************************************/
72
73
74
75
76
[637]77/**************************************************************************************/
[649]78
[637]79/* */
[649]80
[637]81/* pour les MLPA : gain = 100 diviseur = 101 ou 330 */
[649]82
[637]83/* pour les bebodiff : gain = diviseur = 100Kohm / R preampli */
[649]84
[637]85/* pour les bebodiff : la capa est corrigee d'un facteur 0.868 */
[649]86
[637]87/* pour les cartes modifiees : mettre diviseur=0 */
[649]88
[637]89/* et capa = la resistance de chage en Megohm */
[649]90
[637]91/* */
[649]92
[637]93/**************************************************************************************/
94
95
[649]96
97
98
[645]99/* numero_nom, on/off , 0 = MLPA , N° bolo , gain_pa , capa*1000 , diviseur , coef*10000 */
[649]100
[639]101/* , 0 ou 1 , 2..8 = BEBO , hard , , 4700 , 333 , */
[649]102
[639]103/* 10 = Bediff , , , */
[637]104
[649]105
106
[639]107/* pour les bediff (code 10) le n° de bolo est N° de bebo*8 + numero dans la bebo */
[649]108
[639]109/* soit : 1 2 3 4 5 6 .. 9 10 11 12 13 14 .. 17 18 19 20 21 22 .. etc */
[637]110
111
[649]112
113
114
[637]115/*debut_param*/
[649]116
[637]117/*---------------------------------- fenetre : -----------------------------------*/
118
119
[649]120
121/* ------------------------ configuration de vol 5 juillet 99-----------------------------*/
122
123param_bolo parametr={28,24,36,88,18,
124
125
126
[639]127{
[637]128
[649]129{ 11 , 2,10, 1 , 200, 22000 , 200 }, /* 1 */
[637]130
[649]131{ 9 , 1,10, 2 , 200, 22000 , 200 },
[637]132
[649]133{ 8 , 1,10, 3 , 200, 22000 , 200 },
[637]134
[649]135{ 14 , 2,10, 4 , 200, 22000 , 200 },
[643]136
137
[649]138
139{ 5 , 1,10, 5 ,1000, 4700 , 1000 }, /* 5 */
140
141{ 0 , 2,10, 6 ,1000, 4700 , 1000 },
142
143{ 10 , 1,10, 9 ,1000, 4700 , 1000 },
144
145{ 0 , 2,10,10, 1000, 4700 , 1000 },
146
147
148
149{ 2 , 1,10,11, 1000, 4700 , 1000 }, /* 9 */
150
151{ 4 , 1,10,12, 1000, 4700 , 1000 },
152
153{ 7 , 2,10,13, 1000, 4700 , 1000 },
154
155{ 1 , 1,10,14, 1000, 4700 , 1000 },
156
157
158
159{ 13 , 1,10,17, 1000, 4700 , 1000 }, /* 13 */
160
161{ 3 , 1,10,18, 1000, 4700 , 1000 },
162
163{ 12 , 1,10,19, 1000, 4700 , 1000 },
164
165{ 6 , 1,10,20, 1000, 4700 , 1000 },
166
167
168
169{ 15 , 1,10,21, 200, 22000 , 200 }, /* 17 */
170
171{ 16 , 1,10,22, 200, 22000 , 200 },
172
173{ 17 , 1,10,25, 500, 22000 , 500 },
174
175{ 18 , 2,10,26, 500, 22000 , 500 },
176
177
178
179{ 20 , 3,10,27, 1000, 22000 , 0 }, /* 21 */
180
181{ 21 , 3,10,28, 1000, 1000 , 0 },
182
183{ 22 , 3,10,29, 1000, 1000 , 0 },
184
185{ 23 , 3,10,30, 1000, 1000 , 0 },
186
187
188
[643]189},
[649]190
[643]191{
192
[649]193{ "Niente " , { 5000 , 0 , 0, 0,0,0,0} }, /* 0 */
194
195{ "ch1-bolo1" , { 5000 , 600000 , 154000, 63039, 25000, 0, 0} }, /* 1 */
196
197{ "ch1-bolo2" , { 5000 , 600000 , 154000, 47279, 25000, 0, 0} },
198
199{ "ch1-bolo3" , { 5000 , 600000 , 154000, 51219, 25000, 0, 0} },
200
201{ "ch2-bolo4" , { 5000 , 600000 , 154000, 70919, 25000, 0, 0} },
202
203{ "ch2-bolo5" , { 5000 , 600000 , 154000, 78799, 25000, 0, 0} },
204
205{ "ch3-bolo6" , { 5000 , 600000 , 154000, 86678, 25000, 0, 0} },
206
207
208
209{ "Dum100mK1" , { 5000 , 588000 , 125000, 0,0,0,0} }, /* 7 */
210
[645]211{ "Dum100mK2" , { 5000 , 588000 , 125000, 0,0,0,0} },
[643]212
[649]213/*{ "Dum100mK3" , { 5000 , 1361800 , 125000, 0,0,0,0} }, */
214
215{ "Dum100mK4" , { 5000 , 1361800 , 125000, 0,0,0,0} }, /* 9 */
216
217/*{ "Dum100mK5" , { 5000 , 1361800 , 125000, 0,0,0,0} }, */
218
219{ "Dum100mK6" , { 5000 , 1361800 , 125000, 0,0,0,0} },
220
221
222
223{ "Lou100mK1" , { 5000 , 5680000 , 560000, 0,0,0,0} }, /* 11 */
224
[645]225{ "Lou100mK2" , { 5000 , 5680000 , 560000, 0,0,0,0} },
[643]226
[649]227{ "Lou100mK3" , { 5000 , 5680000 , 560000, 0,0,0,0} },
[643]228
[649]229{ "Lou100mK4" , { 5000 , 5680000 , 560000, 0,0,0,0} },
[643]230
231
[649]232
233{ "Lou1.6K5 " , { 5000 , 0 , 0, 0,0,0,0} }, /* 15 */
234
235{ "Lou1.6K6 " , { 5000 , 0 , 0, 0,0,0,0} },
236
237{ "Lou10K7 " , { 5000 , 0 , 0, 0,0,0,0} },
238
239{ "Lou10K8 " , { 5000 , 0 , 0, 0,0,0,0} },
240
241
242
243{ "R10MOhm " , { 5000 , 0 , 0, 0,0,0,0} }, /* 19 */
244
245
246
247/* La germanium doit toujours etre en premier par rapport aux autres thermos absolus */
248
249{ "germanium" , { 0 , 30719 , -910 , -16389 , 2927 , 0, 0} }, /* 20 */
250
251{ "therm_4k" , { 45000 , 28907 , -16028 , -1327 , 1472 , 872, 52500} },
252
253{ "therm_1.6k" , { 45000 , 28907 , -16028 , -1327 , 1472 , 872, 566700} },
254
255{ "therm_10k" , { 45000 , 28907 , -16028 , -1327 , 1472 , 872, 138100} },
256
257
258
[637]259}
[643]260
[649]261
262
[637]263};
[649]264
[637]265/*fin_param*/
266
[649]267
268
[645]269/* Definition Mai-Juin 1999
[649]270
[645]271{
[649]272
[645]273{ "v1-bedif1" , 1,10,1 , 200, 22000 , 200, { 5000 , 123100 , 334200,0,0,0,0} },
[649]274
[645]275{ "v1-bedif2" , 1,10,2 , 200, 22000 , 200, { 500 , 136180 , 9010,0,0,0,0} },
[649]276
[645]277{ "v1-bedif3" , 1,10,3 , 200, 22000 , 200, { 500 , 136180 , 9010,0,0,0,0} },
[649]278
[645]279{ "v1-bedif4" , 1,10,4 , 200, 22000 , 200, { 5000 , 123100 , 334200,0,0,0,0} },
[649]280
[645]281{ "v1-bedif5" , 1,10,5 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]282
[645]283{ "v1-bedif6" , 1,10,6 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[637]284
[649]285
286
[645]287{ "v1-bedif7" , 1,10,9 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]288
[645]289{ "v1-bedif8" , 1,10,10, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]290
[645]291{ "v1-bedif9" , 1,10,11, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]292
[645]293{ "v1-bedif10" , 1,10,12, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]294
[645]295{ "v1-bedif11" , 1,10,13, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]296
[645]297{ "v1-bedif12" , 1,10,14, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[637]298
[649]299
300
[645]301{ "v1-bedif13" , 1,10,17, 1000, 100000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]302
[645]303{ "v1-bedif14" , 1,10,18, 1000, 470000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]304
[645]305{ "bedif15" , 1,10,19, 1000, 470000 , 1000, { 500 , 58800 , 12500,0,0,0,0} },
[649]306
[645]307{ "bedif16" , 1,10,20, 1000,2200000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]308
[645]309{ "bedif17" , 1,10,21, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]310
[645]311{ "bedif18" , 1,10,22, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
312
[649]313
314
[645]315{ "v1-bedif19" , 2,10,25, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]316
[645]317{ "v1-bedif20" , 2,10,26, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[649]318
[645]319{ "germanium" , 3,10,27, 1000, 22000 , 0, { 3500 , 17100 , 646500,0,0,0,0} },
[649]320
[645]321{ "therm_4k" , 3,10,28, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
[649]322
[645]323{ "therm_1.6k" , 3,10,29, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
[649]324
[645]325{ "therm_10k" , 3,10,30, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
326
[649]327
328
[645]329}*/
330
[649]331
332
[637]333/* bolos campagne 1998-1999 */
[649]334
[637]335/*
[649]336
[637]337reg_NbSi.J, 1, 0, 1, 100, 4.7, 333, .5 ,519.6 , 8.286
[649]338
[637]339v1-231...L, 1, 0, 2, 100, 4.7, 333, .5 , 1.7 , 32.41 , 0.333 , 10 , 20.30 , 11.41
[649]340
[637]341v1-232...N, 1, 0, 3, 100, 4.7, 333,
[649]342
[637]343v1-237...E, 1, 0, 4, 100, 4.7, 333,
344
[649]345
346
[637]347reg_JamieO, 1, 0, 5, 100, 4.7, 101,
348
[649]349
350
[637]351V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
[649]352
[637]353V2-230...B, 1, 0, 7, 100, 4.7, 333, .5 , 8.26 , 26.61 , 5.10 , 7 , 9.354 , 1.026
[649]354
[637]355V2-205...Q, 1, 0, 8, 100, 4.7, 333, .518 , 81 , 25.2
[649]356
[637]357V2-208...P, 1, 0, 9, 100, 4.7, 333, .5 , 12.31 , 33.42 , 0.627 , 6.5 , 8.113 , 2.958
358
[649]359
360
[637]361*/
[649]362
[637]363/*bolos campagne 1997-1998 */
[649]364
[637]365/*
366
[649]367
368
[637]369v1-208...J, 1, 0, 1, 100, 4.7, 333, .5 , 12.31 , 33.42
[649]370
[637]371v1-232...L, 1, 0, 2, 100, 4.7, 333,
[649]372
[637]373v1-205...N, 1, 0, 3, 100, 4.7, 333, .518 , 81 , 25.2
[649]374
[637]375v1-NbSi..E, 1, 0, 4, 100, 4.7, 333, .5 ,519.6 , 8.286
[649]376
[637]377Jamie....O, 1, 0, 5, 100, 4.7, 101,
[649]378
[637]379V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
[649]380
[637]381V2-224...B, 1, 0, 7, 100, 4.7, 333, .5 ,3.43 , 26.6
[649]382
[637]383V2-230...Q, 1, 0, 8, 100, 4.7, 333, .5 , 8.26 , 26.61
[649]384
[637]385V2-231...P, 1, 0, 9, 100, 4.7, 333, .5 , 1.7 , 32.41
386
[649]387
388
[637]389*/
390
391
[649]392
393
394
[643]395int mode_transmission_telemesure[nb_modes_telemesure][nb_type_blocks]= {
[637]396
[649]397
398
[643]399/* enregisteur de bord flash : plafond standard nominal */
[637]400
[649]401/* 0*/ { 0,10,15,50, 10,50, 0, 0, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0},
[637]402
[643]403
[649]404
405/* 1*/ { 0,10,10, 1, 10, 3, 0, 0, 0, 1, 0, 0, 1, 0, 4,2500, 0, 0, 0, 0},
406
407
408
409/* 2*/ { 0,10,05,01, 10,06, 0, 0, 0, 1, 0, 0, 1, 0, 2,2500, 0, 0, 0, 0},
410
411
412
[643]413/* 3*/ { 0,10, 1,25, 10, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0},
414
[649]415
416
[643]417/* 4*/ { 0,10,15,50, 10,25, 0, 0, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
418
[649]419
420
[643]421/* 5*/ { 0,10,15,50, 10,25, 0, 0, 0, 0, 1, 0, 0, 0, 0,2500, 0, 0, 0, 0},
422
[649]423
424
[643]425/* 6*/ { 0,10,15,50, 10,50, 0, 0, 0, 1, 0, 0, 1, 0, 2,2500, 0, 0, 0, 0},
426
427
428
[649]429/* 7*/ { 0,10,15,50,100,50, 1, 1, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0},
[643]430
[649]431
432
433/* 8*/ { 0,10,15,50,100,50, 1, 1, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
434
435
436
437/* 9*/ { 0,10, 1, 1,100, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0}
438
439
440
[643]441 };
442
443
444
[649]445
446
447
448
[643]449int mode_transmission_flash[nb_modes_flash][nb_type_blocks]= {
450
451
[649]452
453
454
[643]455/* enregisteur de bord flash : nominal */
[649]456
[643]457/* 0*/ { 0,50,15,25, 10,25, 0, 0, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0} ,
458
[649]459
460
[643]461/* enregisteur de bord flash : minimum */
[649]462
[643]463/* 1*/ { 0,50,50,50,50,100, 0, 0, 0, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0} ,
464
[649]465
466
[643]467/* enregisteur de bord flash : rien */
[649]468
[643]469/* 2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} };
470
471
472
473
474
475
476
477
478
[649]479/*debut_nom_reglage*/
[643]480
[649]481/* 0->1 - demarrage par defaut - Nominal*/
[643]482
[649]483/* 1->2 - idem*/
[643]484
[649]485/* 2->3 - faible courant*/
[643]486
[649]487/* 3->4 - fort courant*/
[643]488
[649]489/* 4->5 - non fffdéfini*/
[643]490
[649]491/* 5->6 - non défini*/
[643]492
[649]493/* 6->7 - non défini*/
[643]494
[649]495/* 7->8 - non défini*/
[643]496
[637]497/*fin_nom_reglage*/
498
499
500
501
502
503
504
[639]505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
[649]550
551
552
553
554
555
556
557
558
559
560
561
562
[637]563reglage_bolo reglage_standard[8]={{
564
565
[649]566
567
568
[637]569/*debut reglage 0 */
[649]570
[639]571#ifdef programme
[649]572
573{32,76,8,1},{
574
[639]575{20,0}
[649]576
577,{1311522837,256000}
578
579,{1048576021,256004}
580
[637]581,{20,0}
[649]582
583,{1048576021,256001}
584
[637]585,{20,0}
[649]586
587,{262144021,128003}
588
[639]589,{20,0}
[649]590
591,{262144021,128001}
592
593,{262144021,128001}
594
[639]595,{20,0}
[649]596
597,{1048576021,256257}
598
599,{1048576021,256003}
600
601,{262144021,128001}
602
603,{262144789,128001}
604
605,{262144021,128001}
606
607,{100663317,256002}
608
609,{100716053,155650}
610
611,{1048576277,256003}
612
[639]613,{20,0}
[649]614
615,{1024021,0}
616
617,{262165,0}
618
619,{65557,0}
620
621,{1024020,0}
622
[637]623},{
[649]624
625{1,21,16,4}
626
627,{1,21,13,4}
628
629,{1,21,20,4}
630
631,{1,21,20,4}
632
633,{0,21,0,4}
634
635,{0,21,0,4}
636
[637]637},{
[649]638
639{3,1,21,24,21,24,0}
640
[637]641,{0,1,9,1,0,0,0}
[649]642
[637]643,{0,1,9,1,0,0,0}
[649]644
645,{6,1,9,34,30,0,65326}
646
647},{5,3,129,108,0,126,104,88}
648
[639]649#else
[649]650
651{1,8,76,32},{
652
[639]653{20,0}
[649]654
655,{1311522837,256000}
656
657,{1048576021,256004}
658
[639]659,{20,0}
[649]660
661,{1048576021,256001}
662
[639]663,{20,0}
[649]664
665,{262144021,128003}
666
[639]667,{20,0}
[649]668
669,{262144021,128001}
670
671,{262144021,128001}
672
[639]673,{20,0}
[649]674
675,{1048576021,256257}
676
677,{1048576021,256003}
678
679,{262144021,128001}
680
681,{262144789,128001}
682
683,{262144021,128001}
684
685,{100663317,256002}
686
687,{100716053,155650}
688
689,{1048576277,256003}
690
[639]691,{20,0}
[649]692
693,{1024021,0}
694
695,{262165,0}
696
697,{65557,0}
698
699,{1024020,0}
700
[639]701},{
[649]702
703{4,16,21,1}
704
705,{4,13,21,1}
706
707,{4,20,21,1}
708
709,{4,20,21,1}
710
711,{4,0,21,0}
712
713,{4,0,21,0}
714
[639]715},{
[649]716
717{24,21,1,3,0,24,21}
718
[639]719,{1,9,1,0,0,0,0}
[649]720
[639]721,{1,9,1,0,0,0,0}
[649]722
723,{34,9,1,6,65326,0,30}
724
725},{108,129,3,5,88,104,126,0}
726
[639]727#endif
[649]728
[637]729/*fin_reglage*/
730
[649]731
732
733
734
[637]735},{
736
[649]737
738
[637]739/*debut reglage 1 */
[649]740
[639]741#ifdef programme
[649]742
743{32,76,8,1},{
744
[639]745{20,0}
[649]746
747,{1311522837,256000}
748
749,{1048576021,256004}
750
[637]751,{20,0}
[649]752
753,{1048576021,256001}
754
[637]755,{20,0}
[649]756
757,{262144021,128003}
758
[639]759,{20,0}
[649]760
761,{262144021,128001}
762
763,{262144021,128001}
764
[639]765,{20,0}
[649]766
767,{1048576021,256257}
768
769,{1048576021,256003}
770
771,{262144021,128001}
772
773,{262144789,128001}
774
775,{262144021,128001}
776
777,{100663317,256002}
778
779,{100716053,155650}
780
781,{1048576277,256003}
782
[639]783,{20,0}
[649]784
785,{1024021,0}
786
787,{262165,0}
788
789,{65557,0}
790
791,{1024020,0}
792
[637]793},{
[649]794
795{1,21,16,4}
796
797,{1,21,13,4}
798
799,{1,21,20,4}
800
801,{1,21,20,4}
802
803,{0,21,0,4}
804
805,{0,21,0,4}
806
[637]807},{
[649]808
809{3,1,21,24,21,24,0}
810
[637]811,{0,1,9,1,0,0,0}
[649]812
[637]813,{0,1,9,1,0,0,0}
[649]814
815,{6,1,9,34,30,0,65326}
816
817},{5,3,129,108,0,126,104,88}
818
[639]819#else
[649]820
821{1,8,76,32},{
822
[639]823{20,0}
[649]824
825,{1311522837,256000}
826
827,{1048576021,256004}
828
[639]829,{20,0}
[649]830
831,{1048576021,256001}
832
[639]833,{20,0}
[649]834
835,{262144021,128003}
836
[639]837,{20,0}
[649]838
839,{262144021,128001}
840
841,{262144021,128001}
842
[639]843,{20,0}
[649]844
845,{1048576021,256257}
846
847,{1048576021,256003}
848
849,{262144021,128001}
850
851,{262144789,128001}
852
853,{262144021,128001}
854
855,{100663317,256002}
856
857,{100716053,155650}
858
859,{1048576277,256003}
860
[639]861,{20,0}
[649]862
863,{1024021,0}
864
865,{262165,0}
866
867,{65557,0}
868
869,{1024020,0}
870
[639]871},{
[649]872
873{4,16,21,1}
874
875,{4,13,21,1}
876
877,{4,20,21,1}
878
879,{4,20,21,1}
880
881,{4,0,21,0}
882
883,{4,0,21,0}
884
[639]885},{
[649]886
887{24,21,1,3,0,24,21}
888
[639]889,{1,9,1,0,0,0,0}
[649]890
[639]891,{1,9,1,0,0,0,0}
[649]892
893,{34,9,1,6,65326,0,30}
894
895},{108,129,3,5,88,104,126,0}
896
[639]897#endif
[649]898
[637]899/*fin_reglage*/
900
[649]901
902
[637]903},{
904
[649]905
906
[637]907/*debut reglage 2 */
[649]908
[639]909#ifdef programme
[649]910
911{32,76,8,1},{
912
913{20,0}
914
915,{100721941,256000}
916
917,{1048607509,256004}
918
919,{20,0}
920
921,{1048586773,256003}
922
923,{20,0}
924
925,{50335509,128001}
926
927,{20,0}
928
929,{50331669,128001}
930
931,{50336789,128001}
932
933,{20,0}
934
935,{1048622101,256259}
936
937,{1048635413,256003}
938
939,{50331669,128001}
940
941,{50352661,128001}
942
943,{50337813,128001}
944
945,{100665109,256002}
946
947,{100664597,155650}
948
949,{1048600341,256003}
950
951,{20,0}
952
953,{1024021,0}
954
955,{65557,0}
956
957,{65557,0}
958
959,{262165,0}
960
[637]961},{
[649]962
963{1,21,11,4}
964
965,{1,21,13,4}
966
967,{1,21,20,4}
968
969,{1,21,20,4}
970
971,{0,20,0,1}
972
973,{0,20,0,1}
974
[637]975},{
[649]976
977{3,1,21,24,21,24,0}
978
979,{0,1,9,1,0,0,0}
980
981,{0,1,9,1,0,0,0}
982
983,{6,17,0,34,30,0,65386}
984
985},{5,3,129,108,0,126,104,88}
986
[639]987#else
[649]988
989{1,8,76,32},{
990
991{20,0}
992
993,{100721941,256000}
994
995,{1048607509,256004}
996
997,{20,0}
998
999,{1048586773,256003}
1000
1001,{20,0}
1002
1003,{50335509,128001}
1004
1005,{20,0}
1006
1007,{50331669,128001}
1008
1009,{50336789,128001}
1010
1011,{20,0}
1012
1013,{1048622101,256259}
1014
1015,{1048635413,256003}
1016
1017,{50331669,128001}
1018
1019,{50352661,128001}
1020
1021,{50337813,128001}
1022
1023,{100665109,256002}
1024
1025,{100664597,155650}
1026
1027,{1048600341,256003}
1028
1029,{20,0}
1030
1031,{1024021,0}
1032
1033,{65557,0}
1034
1035,{65557,0}
1036
1037,{262165,0}
1038
[639]1039},{
[649]1040
1041{4,11,21,1}
1042
1043,{4,13,21,1}
1044
1045,{4,20,21,1}
1046
1047,{4,20,21,1}
1048
1049,{1,0,20,0}
1050
1051,{1,0,20,0}
1052
[639]1053},{
[649]1054
1055{24,21,1,3,0,24,21}
1056
1057,{1,9,1,0,0,0,0}
1058
1059,{1,9,1,0,0,0,0}
1060
1061,{34,0,17,6,65386,0,30}
1062
1063},{108,129,3,5,88,104,126,0}
1064
[639]1065#endif
[649]1066
[637]1067/*fin_reglage*/
1068
[649]1069
1070
[637]1071},{
1072
[649]1073
1074
[637]1075/*debut reglage 3 */
[649]1076
[639]1077#ifdef programme
[649]1078
1079{32,76,8,1},{
1080
[639]1081{20,0}
[649]1082
1083,{100721941,256000}
1084
1085,{1048607509,256004}
1086
[637]1087,{20,0}
[649]1088
1089,{1048586773,256003}
1090
[637]1091,{20,0}
[649]1092
1093,{524291861,128001}
1094
[639]1095,{20,0}
[649]1096
1097,{524288021,128001}
1098
1099,{524293141,128001}
1100
[639]1101,{20,0}
[649]1102
1103,{1048622101,256259}
1104
1105,{1048635413,256003}
1106
1107,{524288021,128001}
1108
1109,{524309013,128001}
1110
1111,{524294165,128001}
1112
1113,{100665109,256002}
1114
1115,{100664597,155650}
1116
1117,{1048600341,256003}
1118
[639]1119,{20,0}
[649]1120
1121,{1024021,0}
1122
1123,{65557,0}
1124
1125,{65557,0}
1126
1127,{65557,0}
1128
[637]1129},{
[649]1130
1131{1,21,18,4}
1132
1133,{1,21,13,4}
1134
1135,{1,21,20,4}
1136
1137,{1,21,20,4}
1138
1139,{0,20,0,1}
1140
1141,{0,20,0,1}
1142
[637]1143},{
[649]1144
1145{3,1,21,24,21,24,0}
1146
[639]1147,{0,1,9,1,0,0,0}
[649]1148
[639]1149,{0,1,9,1,0,0,0}
[649]1150
1151,{6,17,0,34,30,0,65386}
1152
1153},{5,3,129,108,0,126,104,88}
1154
[639]1155#else
[649]1156
1157{1,8,76,32},{
1158
[639]1159{20,0}
[649]1160
1161,{100721941,256000}
1162
1163,{1048607509,256004}
1164
[639]1165,{20,0}
[649]1166
1167,{1048586773,256003}
1168
[639]1169,{20,0}
[649]1170
1171,{524291861,128001}
1172
[639]1173,{20,0}
[649]1174
1175,{524288021,128001}
1176
1177,{524293141,128001}
1178
[639]1179,{20,0}
[649]1180
1181,{1048622101,256259}
1182
1183,{1048635413,256003}
1184
1185,{524288021,128001}
1186
1187,{524309013,128001}
1188
1189,{524294165,128001}
1190
1191,{100665109,256002}
1192
1193,{100664597,155650}
1194
1195,{1048600341,256003}
1196
[639]1197,{20,0}
[649]1198
1199,{1024021,0}
1200
1201,{65557,0}
1202
1203,{65557,0}
1204
1205,{65557,0}
1206
[639]1207},{
[649]1208
1209{4,18,21,1}
1210
1211,{4,13,21,1}
1212
1213,{4,20,21,1}
1214
1215,{4,20,21,1}
1216
1217,{1,0,20,0}
1218
1219,{1,0,20,0}
1220
[639]1221},{
[649]1222
1223{24,21,1,3,0,24,21}
1224
[639]1225,{1,9,1,0,0,0,0}
[649]1226
[639]1227,{1,9,1,0,0,0,0}
[649]1228
1229,{34,0,17,6,65386,0,30}
1230
1231},{108,129,3,5,88,104,126,0}
1232
[639]1233#endif
[649]1234
[637]1235/*fin_reglage*/
1236
[649]1237
1238
[637]1239},{
1240
[649]1241
1242
[637]1243/*debut reglage 4 */
[649]1244
[639]1245#ifdef programme
[649]1246
1247{39,62,9,1},{
1248
[639]1249{20,0}
[649]1250
1251,{-100659180,229382}
1252
1253,{-100659436,294918}
1254
[637]1255,{20,0}
[649]1256
1257,{-100663276,221189}
1258
1259,{-100663276,5}
1260
1261,{-100659436,245762}
1262
1263,{-100663276,5}
1264
1265,{-100658154,245761}
1266
1267,{-100658156,253954}
1268
[637]1269,{20,0}
[649]1270
1271,{-100663276,204805}
1272
1273,{-100663276,16389}
1274
1275,{-100656874,1}
1276
1277,{-100656874,16385}
1278
1279,{-100663276,3}
1280
1281,{-100506347,6}
1282
1283,{-100509675,6}
1284
1285,{-100372972,6}
1286
1287,{2097174,0}
1288
[639]1289,{1024022,0}
[649]1290
1291,{16406,0}
1292
1293,{4117,0}
1294
1295,{262164,0}
1296
[639]1297},{
[649]1298
1299{2,22,24,1}
1300
1301,{1,20,24,4}
1302
1303,{0,20,24,4}
1304
1305,{0,20,24,3}
1306
1307,{0,20,24,4}
1308
1309,{0,20,24,4}
1310
[639]1311},{
[649]1312
[639]1313{0,1,9,1,0,0,0}
[649]1314
[639]1315,{0,1,9,1,0,0,0}
[649]1316
[639]1317,{0,1,9,1,0,0,0}
[649]1318
[639]1319,{0,1,9,1,0,0,0}
[649]1320
1321},{2,3,129,108,2,126,104,88}
1322
[639]1323#else
[649]1324
1325{1,9,62,39},{
1326
[639]1327{20,0}
[649]1328
1329,{-100659180,229382}
1330
1331,{-100659436,294918}
1332
[639]1333,{20,0}
[649]1334
1335,{-100663276,221189}
1336
1337,{-100663276,5}
1338
1339,{-100659436,245762}
1340
1341,{-100663276,5}
1342
1343,{-100658154,245761}
1344
1345,{-100658156,253954}
1346
[639]1347,{20,0}
[649]1348
1349,{-100663276,204805}
1350
1351,{-100663276,16389}
1352
1353,{-100656874,1}
1354
1355,{-100656874,16385}
1356
1357,{-100663276,3}
1358
1359,{-100506347,6}
1360
1361,{-100509675,6}
1362
1363,{-100372972,6}
1364
1365,{2097174,0}
1366
[639]1367,{1024022,0}
[649]1368
1369,{16406,0}
1370
1371,{4117,0}
1372
1373,{262164,0}
1374
[639]1375},{
[649]1376
1377{1,24,22,2}
1378
1379,{4,24,20,1}
1380
1381,{4,24,20,0}
1382
1383,{3,24,20,0}
1384
1385,{4,24,20,0}
1386
1387,{4,24,20,0}
1388
[639]1389},{
[649]1390
[639]1391{1,9,1,0,0,0,0}
[649]1392
[639]1393,{1,9,1,0,0,0,0}
[649]1394
[639]1395,{1,9,1,0,0,0,0}
[649]1396
[639]1397,{1,9,1,0,0,0,0}
[649]1398
1399},{108,129,3,2,88,104,126,2}
1400
[639]1401#endif
[649]1402
[639]1403/*fin_reglage*/
1404
[649]1405
1406
[639]1407},{
1408
[649]1409
1410
[639]1411/*debut reglage 5 */
[649]1412
[639]1413#ifdef programme
[649]1414
1415{39,68,9,1},{
1416
1417{20,0}
1418
1419,{1048982293,229382}
1420
1421,{1049128469,253958}
1422
1423,{20,0}
1424
1425,{1048966677,245765}
1426
1427,{20,0}
1428
1429,{262157846,245762}
1430
1431,{1048919829,5}
1432
1433,{262156054,245761}
1434
1435,{262154006,253954}
1436
1437,{20,0}
1438
1439,{1049123349,229381}
1440
1441,{1049157141,237573}
1442
1443,{262154262,1}
1444
1445,{262158614,16385}
1446
1447,{262149654,3}
1448
1449,{262750740,237572}
1450
1451,{262606612,122884}
1452
1453,{-1174095083,139270}
1454
1455,{20,0}
1456
1457,{16406,0}
1458
1459,{16406,0}
1460
1461,{4117,0}
1462
1463,{262164,0}
1464
[637]1465},{
[649]1466
1467{1,22,16,1}
1468
1469,{1,22,16,4}
1470
1471,{1,22,16,4}
1472
1473,{1,20,16,3}
1474
1475,{1,21,20,4}
1476
1477,{1,21,20,4}
1478
[637]1479},{
[649]1480
1481{0,1,9,1,0,0,0}
1482
1483,{0,1,9,1,0,0,0}
1484
1485,{0,1,9,1,0,0,0}
1486
1487,{0,1,9,1,0,0,0}
1488
1489},{2,3,129,108,3,126,104,88}
1490
[639]1491#else
[649]1492
1493{1,9,68,39},{
1494
1495{20,0}
1496
1497,{1048982293,229382}
1498
1499,{1049128469,253958}
1500
1501,{20,0}
1502
1503,{1048966677,245765}
1504
1505,{20,0}
1506
1507,{262157846,245762}
1508
1509,{1048919829,5}
1510
1511,{262156054,245761}
1512
1513,{262154006,253954}
1514
1515,{20,0}
1516
1517,{1049123349,229381}
1518
1519,{1049157141,237573}
1520
1521,{262154262,1}
1522
1523,{262158614,16385}
1524
1525,{262149654,3}
1526
1527,{262750740,237572}
1528
1529,{262606612,122884}
1530
1531,{-1174095083,139270}
1532
1533,{20,0}
1534
1535,{16406,0}
1536
1537,{16406,0}
1538
1539,{4117,0}
1540
1541,{262164,0}
1542
[639]1543},{
[649]1544
1545{1,16,22,1}
1546
1547,{4,16,22,1}
1548
1549,{4,16,22,1}
1550
1551,{3,16,20,1}
1552
1553,{4,20,21,1}
1554
1555,{4,20,21,1}
1556
[639]1557},{
[649]1558
1559{1,9,1,0,0,0,0}
1560
1561,{1,9,1,0,0,0,0}
1562
1563,{1,9,1,0,0,0,0}
1564
1565,{1,9,1,0,0,0,0}
1566
1567},{108,129,3,2,88,104,126,3}
1568
[639]1569#endif
[649]1570
[637]1571/*fin_reglage*/
1572
[649]1573
1574
[637]1575},{
1576
[649]1577
1578
[639]1579/*debut reglage 6 */
[649]1580
[639]1581#ifdef programme
[649]1582
[643]1583{197,191,175,185},{
[649]1584
[639]1585{0,0}
[649]1586
[637]1587,{0,0}
[649]1588
[637]1589,{0,0}
[649]1590
[637]1591,{0,0}
[649]1592
[637]1593,{0,0}
[649]1594
[637]1595,{0,0}
[649]1596
[637]1597,{0,0}
[649]1598
[639]1599,{0,0}
[649]1600
[639]1601,{0,0}
[649]1602
[639]1603,{0,0}
[649]1604
[639]1605,{0,0}
[649]1606
[639]1607,{0,0}
[649]1608
[639]1609,{0,0}
[649]1610
[639]1611,{0,0}
[649]1612
[639]1613,{0,0}
[649]1614
[639]1615,{0,0}
[649]1616
[639]1617,{0,0}
[649]1618
[639]1619,{0,0}
[649]1620
[639]1621,{0,0}
[649]1622
[639]1623,{0,0}
[649]1624
[639]1625,{0,0}
[649]1626
[639]1627,{0,0}
[649]1628
[639]1629,{0,0}
[649]1630
[639]1631,{0,0}
[649]1632
[637]1633},{
[649]1634
[639]1635{106,98,93,71}
[649]1636
[639]1637,{66,74,87,66}
[649]1638
[639]1639,{48,46,38,33}
[649]1640
[639]1641,{40,41,33,26}
[649]1642
[639]1643,{25,29,40,57}
[649]1644
[639]1645,{63,62,71,80}
[649]1646
[637]1647},{
[649]1648
[639]1649{83,79,75,75,92,112,31100}
[649]1650
[639]1651,{125,126,117,113,107,94,20315}
[649]1652
[639]1653,{108,116,122,124,117,120,32117}
[649]1654
[639]1655,{110,99,94,98,107,93,17217}
[649]1656
[639]1657},{88,82,94,108,111,126,104,88}
[649]1658
[639]1659#else
[649]1660
[643]1661{185,175,191,197},{
[649]1662
[639]1663{0,0}
[649]1664
[639]1665,{0,0}
[649]1666
[639]1667,{0,0}
[649]1668
[639]1669,{0,0}
[649]1670
[639]1671,{0,0}
[649]1672
[639]1673,{0,0}
[649]1674
[639]1675,{0,0}
[649]1676
[639]1677,{0,0}
[649]1678
[639]1679,{0,0}
[649]1680
[639]1681,{0,0}
[649]1682
[639]1683,{0,0}
[649]1684
[639]1685,{0,0}
[649]1686
[639]1687,{0,0}
[649]1688
[639]1689,{0,0}
[649]1690
[639]1691,{0,0}
[649]1692
[639]1693,{0,0}
[649]1694
[639]1695,{0,0}
[649]1696
[639]1697,{0,0}
[649]1698
[639]1699,{0,0}
[649]1700
[639]1701,{0,0}
[649]1702
[639]1703,{0,0}
[649]1704
[639]1705,{0,0}
[649]1706
[639]1707,{0,0}
[649]1708
[639]1709,{0,0}
[649]1710
[639]1711},{
[649]1712
[639]1713{71,93,98,106}
[649]1714
[639]1715,{66,87,74,66}
[649]1716
[639]1717,{33,38,46,48}
[649]1718
[639]1719,{26,33,41,40}
[649]1720
[639]1721,{57,40,29,25}
[649]1722
[639]1723,{80,71,62,63}
[649]1724
[639]1725},{
[649]1726
[639]1727{75,75,79,83,31100,112,92}
[649]1728
[639]1729,{113,117,126,125,20315,94,107}
[649]1730
[639]1731,{124,122,116,108,32117,120,117}
[649]1732
[639]1733,{98,94,99,110,17217,93,107}
[649]1734
[639]1735},{108,94,82,88,88,104,126,111}
[649]1736
[639]1737#endif
[649]1738
[637]1739/*fin_reglage*/
1740
[649]1741
1742
[637]1743},{
1744
[649]1745
1746
[637]1747/*debut reglage 7 */
[649]1748
[639]1749#ifdef programme
[649]1750
[643]1751{197,191,175,185},{
[649]1752
[639]1753{0,0}
[649]1754
[639]1755,{0,0}
[649]1756
[639]1757,{0,0}
[649]1758
[639]1759,{0,0}
[649]1760
[639]1761,{0,0}
[649]1762
[639]1763,{0,0}
[649]1764
[639]1765,{0,0}
[649]1766
[639]1767,{0,0}
[649]1768
[639]1769,{0,0}
[649]1770
[639]1771,{0,0}
[649]1772
[639]1773,{0,0}
[649]1774
[639]1775,{0,0}
[649]1776
[639]1777,{0,0}
[649]1778
[639]1779,{0,0}
[649]1780
[639]1781,{0,0}
[649]1782
[639]1783,{0,0}
[649]1784
[639]1785,{0,0}
[649]1786
[639]1787,{0,0}
[649]1788
[639]1789,{0,0}
[649]1790
[639]1791,{0,0}
[649]1792
[639]1793,{0,0}
[649]1794
[639]1795,{0,0}
[649]1796
[639]1797,{0,0}
[649]1798
[639]1799,{0,0}
[649]1800
[639]1801},{
[649]1802
[639]1803{106,98,93,71}
[649]1804
[639]1805,{66,74,87,66}
[649]1806
[639]1807,{48,46,38,33}
[649]1808
[639]1809,{40,41,33,26}
[649]1810
[639]1811,{25,29,40,57}
[649]1812
[639]1813,{63,62,71,80}
[649]1814
[639]1815},{
[649]1816
[639]1817{83,79,75,75,92,112,31100}
[649]1818
[639]1819,{125,126,117,113,107,94,20315}
[649]1820
[639]1821,{108,116,122,124,117,120,32117}
[649]1822
[639]1823,{110,99,94,98,107,93,17217}
[649]1824
[639]1825},{88,82,94,108,111,126,104,88}
[649]1826
[639]1827#else
[649]1828
[643]1829{185,175,191,197},{
[649]1830
[639]1831{0,0}
[649]1832
[639]1833,{0,0}
[649]1834
[639]1835,{0,0}
[649]1836
[639]1837,{0,0}
[649]1838
[639]1839,{0,0}
[649]1840
[639]1841,{0,0}
[649]1842
[639]1843,{0,0}
[649]1844
[639]1845,{0,0}
[649]1846
[639]1847,{0,0}
[649]1848
[639]1849,{0,0}
[649]1850
[639]1851,{0,0}
[649]1852
[639]1853,{0,0}
[649]1854
[639]1855,{0,0}
[649]1856
[639]1857,{0,0}
[649]1858
[639]1859,{0,0}
[649]1860
[639]1861,{0,0}
[649]1862
[639]1863,{0,0}
[649]1864
[639]1865,{0,0}
[649]1866
[639]1867,{0,0}
[649]1868
[639]1869,{0,0}
[649]1870
[639]1871,{0,0}
[649]1872
[639]1873,{0,0}
[649]1874
[639]1875,{0,0}
[649]1876
[639]1877,{0,0}
[649]1878
[639]1879},{
[649]1880
[639]1881{71,93,98,106}
[649]1882
[639]1883,{66,87,74,66}
[649]1884
[639]1885,{33,38,46,48}
[649]1886
[639]1887,{26,33,41,40}
[649]1888
[639]1889,{57,40,29,25}
[649]1890
[639]1891,{80,71,62,63}
[649]1892
[639]1893},{
[649]1894
[639]1895{75,75,79,83,31100,112,92}
[649]1896
[639]1897,{113,117,126,125,20315,94,107}
[649]1898
[639]1899,{124,122,116,108,32117,120,117}
[649]1900
[639]1901,{98,94,99,110,17217,93,107}
[649]1902
[639]1903},{108,94,82,88,88,104,126,111}
[649]1904
[639]1905#endif
[649]1906
[637]1907/*fin_reglage*/
1908
[649]1909
1910
[637]1911} };
1912
[649]1913
1914
[637]1915/* ------------------------------------ corps des fonctions ------------------------------ */
[649]1916
[637]1917/* -------------------------------------------------------------------------------------------- */
1918
1919
1920
[649]1921
1922
1923
1924
1925unsigned int4 val_long(char x)
1926
[637]1927{
[649]1928
[637]1929unsigned long a,xl;
[649]1930
[639]1931char aa;
[649]1932
[639]1933aa=x-2;
[649]1934
[639]1935a=aa;
[649]1936
[639]1937if(x<3) xl=x; else xl=((a&1) + 2)<<(a>>1);
[649]1938
[637]1939return(xl);
[649]1940
[637]1941}
1942
1943
[649]1944
1945
1946
[637]1947double val_double(char x)
[649]1948
[637]1949{
[649]1950
[637]1951unsigned long a,xl;
[649]1952
[637]1953if(x<0) x=-x; a=x; if(!a) xl=0; else xl=((a&1) + 2)<<(a>>1);
[649]1954
[637]1955if(x>0) return(1e-4*(double)xl); else return(-1e-4*(double)xl);
[649]1956
[637]1957}
1958
[649]1959
1960
[637]1961int new_val_dac(int a,char code)
[649]1962
[637]1963{
[649]1964
[637]1965if(code&0x80) a=(code&0x7f) <<5 ;
[649]1966
[637]1967else {
[649]1968
[637]1969 if(code&0x40) a+=code&0x3f;
[649]1970
[637]1971 else a-=code&0x3f;
[649]1972
[637]1973 }
[649]1974
[637]1975return(a);
[649]1976
[637]1977}
1978
1979
1980
1981
[649]1982
1983
1984
1985
1986
[637]1987int calcul_somme_block(block_type_modele* blk,int longueur)
[649]1988
[637]1989{
[649]1990
[637]1991int i,so=0;;
[649]1992
[637]1993for(i=0;i<(longueur/4-4);i++) so^=(int)blk->mot[i];
[649]1994
[637]1995/* somme sur tous les mots internes : on exclus le dbut, les codes et la fin */
[649]1996
[637]1997return((so^(so>>16))&0xffff);
[649]1998
[637]1999}
2000
2001
2002
2003
[649]2004
2005
2006
2007
2008
[637]2009void valide_block(block_type_modele* blk,int type,int block_num)
[649]2010
[637]2011{
[649]2012
[637]2013int somme,longueur;
[649]2014
[637]2015def_long_block
[649]2016
[637]2017longueur=long_block[type];
[649]2018
[637]2019/*printf("valide block adresse %x type %d numblock %d longueur=%d \n" */
[649]2020
[637]2021/* ,(unsigned)blk,type,block_num,longueur);*/
[649]2022
[637]2023blk->debut = debut_block_mesure;
[649]2024
2025somme=0;blk->code1 = (((long)longueur)<<16) | somme;
2026
[637]2027blk->code2 = (((long)block_num) & 0xffffff ) | ( (((long)type)<<24)&0xff000000 );
2028
[649]2029
2030
[637]2031blk->mot[longueur/4-4] = fin_block_mesure;
[649]2032
2033
2034
2035#if defined(_ECC_LIB_H_)
2036
2037{
2038
2039int place_ecc;
2040
2041place_ecc=(longueur-4-ECC_SIZE-SIZE_HEAD-((longueur-4-SIZE_HEAD)/ECC_TOTAL)*ECC_SIZE)/4;
2042
2043SetEcc( blk, (unsigned char *) &(blk->mot[place_ecc] ) ) ;
2044
2045}
2046
2047#endif
2048
2049
2050
[637]2051somme=calcul_somme_block(blk,longueur);
[649]2052
[637]2053blk->code1 = (((long)longueur)<<16) | somme;
[649]2054
2055/* l'ecc est faux car on a change la somme: mettre la somme a zero avant de tester ecc */
2056
[637]2057}
2058
2059
2060
[649]2061/* Quand on est sur une machine swappee, on ne cherche pas a verifier */
[637]2062
[649]2063/* le checksum, puisqu'on a modifie les blocs, sans swapper par exemple */
2064
2065/* les chars des noms de bolometres et des chaines GPS... */
2066
2067#ifdef __alpha
2068
2069#define SWAP
2070
2071#endif
2072
2073#if defined(Linux) || defined(linux)
2074
2075#define SWAP
2076
2077#endif
2078
2079
2080
2081
2082
2083
2084
[637]2085int verifie_block(block_type_modele* blk)
[649]2086
[637]2087{
[649]2088
[637]2089int type,lg,som;
[649]2090
[637]2091def_long_block
[649]2092
[637]2093if(blk->debut != debut_block_mesure) return(block_debut_erreur);
[649]2094
[637]2095type=type_block(blk); if( (type<0) ||(type>=nb_type_blocks) ) return(block_type_inconnu);
[649]2096
[637]2097lg=longueur_block(blk); if( lg != long_block[type] ) return(block_longueur_erreur);
[649]2098
[637]2099if( blk->mot[(lg/4)-4] != fin_block_mesure) return(block_fin_erreur);
[649]2100
2101#ifndef SWAP
2102
[637]2103som=calcul_somme_block(blk,lg); if( som!= somme_block(blk)) return(block_somme_erreur);
[649]2104
2105#endif
2106
[637]2107return(block_correct);
[649]2108
[637]2109}
2110
2111
[649]2112
2113
2114
[637]2115int verifie_block_printf(block_type_modele* blk)
[649]2116
[637]2117{
[649]2118
[637]2119int type,lg,som;
[649]2120
[637]2121def_long_block
[649]2122
[637]2123def_nom_block
[649]2124
[637]2125if(blk->debut != debut_block_mesure)
[649]2126
[637]2127 {
[649]2128
[637]2129 printf(" erreur dans le code debut de block \n");
[649]2130
[637]2131 return(block_debut_erreur);
[649]2132
[637]2133 }
2134
[649]2135
2136
[637]2137type=type_block(blk);
[649]2138
[637]2139if( (type<0) || (type>nb_type_blocks) )
[649]2140
[637]2141 {
[649]2142
[637]2143 printf(" block de type %d inconnu\n",type);
[649]2144
[637]2145 return(block_type_inconnu);
[649]2146
[637]2147 }
2148
[649]2149
2150
[637]2151lg=longueur_block(blk);
[649]2152
[637]2153if( lg!=long_block[type] )
[649]2154
[637]2155 {
[649]2156
[637]2157 printf(" block type %s erreur de longueur (nominal=%d , dans le block=%d \n"
[649]2158
[637]2159 ,nom_block[type],long_block[type],lg);
[649]2160
[637]2161 return(block_longueur_erreur);
[649]2162
[637]2163 }
2164
[649]2165
2166
[637]2167som=calcul_somme_block(blk,lg);
[649]2168
[637]2169if( som!=somme_block(blk) )
[649]2170
[637]2171 {
[649]2172
[637]2173 printf(" block type %s : erreur de somme (calculee=%d , dans le block=%d \n"
[649]2174
[637]2175 ,nom_block[type],som,somme_block(blk) );
[649]2176
[637]2177 return(block_somme_erreur);
[649]2178
[637]2179 }
[649]2180
[637]2181
[649]2182
[637]2183if(blk->mot[(lg/4)-4] != fin_block_mesure)
[649]2184
[637]2185 {
[649]2186
[637]2187 printf(" block type %s erreur de code fin de block : trouve %x au lieu de %x \n"
[649]2188
[637]2189 ,nom_block[type],(int)blk->mot[(lg/4)-4],fin_block_mesure);
[649]2190
[637]2191 return(block_fin_erreur);
[649]2192
[637]2193 }
2194
[649]2195
2196
[637]2197return(block_correct);
[649]2198
[637]2199}
2200
2201
2202
2203
2204
[649]2205
2206
2207
2208
2209
2210
Note: See TracBrowser for help on using the repository browser.