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
Line 
1
2
3#include "manip.h"
4
5#include "archeops.h"
6
7
8
9/* sauve vol trapani 2eme config de vol */
10
11
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
77/**************************************************************************************/
78
79/* */
80
81/* pour les MLPA : gain = 100 diviseur = 101 ou 330 */
82
83/* pour les bebodiff : gain = diviseur = 100Kohm / R preampli */
84
85/* pour les bebodiff : la capa est corrigee d'un facteur 0.868 */
86
87/* pour les cartes modifiees : mettre diviseur=0 */
88
89/* et capa = la resistance de chage en Megohm */
90
91/* */
92
93/**************************************************************************************/
94
95
96
97
98
99/* numero_nom, on/off , 0 = MLPA , N° bolo , gain_pa , capa*1000 , diviseur , coef*10000 */
100
101/* , 0 ou 1 , 2..8 = BEBO , hard , , 4700 , 333 , */
102
103/* 10 = Bediff , , , */
104
105
106
107/* pour les bediff (code 10) le n° de bolo est N° de bebo*8 + numero dans la bebo */
108
109/* soit : 1 2 3 4 5 6 .. 9 10 11 12 13 14 .. 17 18 19 20 21 22 .. etc */
110
111
112
113
114
115/*debut_param*/
116
117/*---------------------------------- fenetre : -----------------------------------*/
118
119
120
121/* ------------------------ configuration de vol 5 juillet 99-----------------------------*/
122
123param_bolo parametr={28,24,36,88,18,
124
125
126
127{
128
129{ 11 , 2,10, 1 , 200, 22000 , 200 }, /* 1 */
130
131{ 9 , 1,10, 2 , 200, 22000 , 200 },
132
133{ 8 , 1,10, 3 , 200, 22000 , 200 },
134
135{ 14 , 2,10, 4 , 200, 22000 , 200 },
136
137
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
189},
190
191{
192
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
211{ "Dum100mK2" , { 5000 , 588000 , 125000, 0,0,0,0} },
212
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
225{ "Lou100mK2" , { 5000 , 5680000 , 560000, 0,0,0,0} },
226
227{ "Lou100mK3" , { 5000 , 5680000 , 560000, 0,0,0,0} },
228
229{ "Lou100mK4" , { 5000 , 5680000 , 560000, 0,0,0,0} },
230
231
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
259}
260
261
262
263};
264
265/*fin_param*/
266
267
268
269/* Definition Mai-Juin 1999
270
271{
272
273{ "v1-bedif1" , 1,10,1 , 200, 22000 , 200, { 5000 , 123100 , 334200,0,0,0,0} },
274
275{ "v1-bedif2" , 1,10,2 , 200, 22000 , 200, { 500 , 136180 , 9010,0,0,0,0} },
276
277{ "v1-bedif3" , 1,10,3 , 200, 22000 , 200, { 500 , 136180 , 9010,0,0,0,0} },
278
279{ "v1-bedif4" , 1,10,4 , 200, 22000 , 200, { 5000 , 123100 , 334200,0,0,0,0} },
280
281{ "v1-bedif5" , 1,10,5 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
282
283{ "v1-bedif6" , 1,10,6 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
284
285
286
287{ "v1-bedif7" , 1,10,9 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
288
289{ "v1-bedif8" , 1,10,10, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
290
291{ "v1-bedif9" , 1,10,11, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
292
293{ "v1-bedif10" , 1,10,12, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
294
295{ "v1-bedif11" , 1,10,13, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
296
297{ "v1-bedif12" , 1,10,14, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
298
299
300
301{ "v1-bedif13" , 1,10,17, 1000, 100000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
302
303{ "v1-bedif14" , 1,10,18, 1000, 470000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
304
305{ "bedif15" , 1,10,19, 1000, 470000 , 1000, { 500 , 58800 , 12500,0,0,0,0} },
306
307{ "bedif16" , 1,10,20, 1000,2200000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
308
309{ "bedif17" , 1,10,21, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
310
311{ "bedif18" , 1,10,22, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
312
313
314
315{ "v1-bedif19" , 2,10,25, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
316
317{ "v1-bedif20" , 2,10,26, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
318
319{ "germanium" , 3,10,27, 1000, 22000 , 0, { 3500 , 17100 , 646500,0,0,0,0} },
320
321{ "therm_4k" , 3,10,28, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
322
323{ "therm_1.6k" , 3,10,29, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
324
325{ "therm_10k" , 3,10,30, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
326
327
328
329}*/
330
331
332
333/* bolos campagne 1998-1999 */
334
335/*
336
337reg_NbSi.J, 1, 0, 1, 100, 4.7, 333, .5 ,519.6 , 8.286
338
339v1-231...L, 1, 0, 2, 100, 4.7, 333, .5 , 1.7 , 32.41 , 0.333 , 10 , 20.30 , 11.41
340
341v1-232...N, 1, 0, 3, 100, 4.7, 333,
342
343v1-237...E, 1, 0, 4, 100, 4.7, 333,
344
345
346
347reg_JamieO, 1, 0, 5, 100, 4.7, 101,
348
349
350
351V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
352
353V2-230...B, 1, 0, 7, 100, 4.7, 333, .5 , 8.26 , 26.61 , 5.10 , 7 , 9.354 , 1.026
354
355V2-205...Q, 1, 0, 8, 100, 4.7, 333, .518 , 81 , 25.2
356
357V2-208...P, 1, 0, 9, 100, 4.7, 333, .5 , 12.31 , 33.42 , 0.627 , 6.5 , 8.113 , 2.958
358
359
360
361*/
362
363/*bolos campagne 1997-1998 */
364
365/*
366
367
368
369v1-208...J, 1, 0, 1, 100, 4.7, 333, .5 , 12.31 , 33.42
370
371v1-232...L, 1, 0, 2, 100, 4.7, 333,
372
373v1-205...N, 1, 0, 3, 100, 4.7, 333, .518 , 81 , 25.2
374
375v1-NbSi..E, 1, 0, 4, 100, 4.7, 333, .5 ,519.6 , 8.286
376
377Jamie....O, 1, 0, 5, 100, 4.7, 101,
378
379V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
380
381V2-224...B, 1, 0, 7, 100, 4.7, 333, .5 ,3.43 , 26.6
382
383V2-230...Q, 1, 0, 8, 100, 4.7, 333, .5 , 8.26 , 26.61
384
385V2-231...P, 1, 0, 9, 100, 4.7, 333, .5 , 1.7 , 32.41
386
387
388
389*/
390
391
392
393
394
395int mode_transmission_telemesure[nb_modes_telemesure][nb_type_blocks]= {
396
397
398
399/* enregisteur de bord flash : plafond standard nominal */
400
401/* 0*/ { 0,10,15,50, 10,50, 0, 0, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0},
402
403
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
413/* 3*/ { 0,10, 1,25, 10, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0},
414
415
416
417/* 4*/ { 0,10,15,50, 10,25, 0, 0, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
418
419
420
421/* 5*/ { 0,10,15,50, 10,25, 0, 0, 0, 0, 1, 0, 0, 0, 0,2500, 0, 0, 0, 0},
422
423
424
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
429/* 7*/ { 0,10,15,50,100,50, 1, 1, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0},
430
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
441 };
442
443
444
445
446
447
448
449int mode_transmission_flash[nb_modes_flash][nb_type_blocks]= {
450
451
452
453
454
455/* enregisteur de bord flash : nominal */
456
457/* 0*/ { 0,50,15,25, 10,25, 0, 0, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0} ,
458
459
460
461/* enregisteur de bord flash : minimum */
462
463/* 1*/ { 0,50,50,50,50,100, 0, 0, 0, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0} ,
464
465
466
467/* enregisteur de bord flash : rien */
468
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
479/*debut_nom_reglage*/
480
481/* 0->1 - demarrage par defaut - Nominal*/
482
483/* 1->2 - idem*/
484
485/* 2->3 - faible courant*/
486
487/* 3->4 - fort courant*/
488
489/* 4->5 - non fffdéfini*/
490
491/* 5->6 - non défini*/
492
493/* 6->7 - non défini*/
494
495/* 7->8 - non défini*/
496
497/*fin_nom_reglage*/
498
499
500
501
502
503
504
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
550
551
552
553
554
555
556
557
558
559
560
561
562
563reglage_bolo reglage_standard[8]={{
564
565
566
567
568
569/*debut reglage 0 */
570
571#ifdef programme
572
573{32,76,8,1},{
574
575{20,0}
576
577,{1311522837,256000}
578
579,{1048576021,256004}
580
581,{20,0}
582
583,{1048576021,256001}
584
585,{20,0}
586
587,{262144021,128003}
588
589,{20,0}
590
591,{262144021,128001}
592
593,{262144021,128001}
594
595,{20,0}
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
613,{20,0}
614
615,{1024021,0}
616
617,{262165,0}
618
619,{65557,0}
620
621,{1024020,0}
622
623},{
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},{
638
639{3,1,21,24,21,24,0}
640
641,{0,1,9,1,0,0,0}
642
643,{0,1,9,1,0,0,0}
644
645,{6,1,9,34,30,0,65326}
646
647},{5,3,129,108,0,126,104,88}
648
649#else
650
651{1,8,76,32},{
652
653{20,0}
654
655,{1311522837,256000}
656
657,{1048576021,256004}
658
659,{20,0}
660
661,{1048576021,256001}
662
663,{20,0}
664
665,{262144021,128003}
666
667,{20,0}
668
669,{262144021,128001}
670
671,{262144021,128001}
672
673,{20,0}
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
691,{20,0}
692
693,{1024021,0}
694
695,{262165,0}
696
697,{65557,0}
698
699,{1024020,0}
700
701},{
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
715},{
716
717{24,21,1,3,0,24,21}
718
719,{1,9,1,0,0,0,0}
720
721,{1,9,1,0,0,0,0}
722
723,{34,9,1,6,65326,0,30}
724
725},{108,129,3,5,88,104,126,0}
726
727#endif
728
729/*fin_reglage*/
730
731
732
733
734
735},{
736
737
738
739/*debut reglage 1 */
740
741#ifdef programme
742
743{32,76,8,1},{
744
745{20,0}
746
747,{1311522837,256000}
748
749,{1048576021,256004}
750
751,{20,0}
752
753,{1048576021,256001}
754
755,{20,0}
756
757,{262144021,128003}
758
759,{20,0}
760
761,{262144021,128001}
762
763,{262144021,128001}
764
765,{20,0}
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
783,{20,0}
784
785,{1024021,0}
786
787,{262165,0}
788
789,{65557,0}
790
791,{1024020,0}
792
793},{
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
807},{
808
809{3,1,21,24,21,24,0}
810
811,{0,1,9,1,0,0,0}
812
813,{0,1,9,1,0,0,0}
814
815,{6,1,9,34,30,0,65326}
816
817},{5,3,129,108,0,126,104,88}
818
819#else
820
821{1,8,76,32},{
822
823{20,0}
824
825,{1311522837,256000}
826
827,{1048576021,256004}
828
829,{20,0}
830
831,{1048576021,256001}
832
833,{20,0}
834
835,{262144021,128003}
836
837,{20,0}
838
839,{262144021,128001}
840
841,{262144021,128001}
842
843,{20,0}
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
861,{20,0}
862
863,{1024021,0}
864
865,{262165,0}
866
867,{65557,0}
868
869,{1024020,0}
870
871},{
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
885},{
886
887{24,21,1,3,0,24,21}
888
889,{1,9,1,0,0,0,0}
890
891,{1,9,1,0,0,0,0}
892
893,{34,9,1,6,65326,0,30}
894
895},{108,129,3,5,88,104,126,0}
896
897#endif
898
899/*fin_reglage*/
900
901
902
903},{
904
905
906
907/*debut reglage 2 */
908
909#ifdef programme
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
961},{
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
975},{
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
987#else
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
1039},{
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
1053},{
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
1065#endif
1066
1067/*fin_reglage*/
1068
1069
1070
1071},{
1072
1073
1074
1075/*debut reglage 3 */
1076
1077#ifdef programme
1078
1079{32,76,8,1},{
1080
1081{20,0}
1082
1083,{100721941,256000}
1084
1085,{1048607509,256004}
1086
1087,{20,0}
1088
1089,{1048586773,256003}
1090
1091,{20,0}
1092
1093,{524291861,128001}
1094
1095,{20,0}
1096
1097,{524288021,128001}
1098
1099,{524293141,128001}
1100
1101,{20,0}
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
1119,{20,0}
1120
1121,{1024021,0}
1122
1123,{65557,0}
1124
1125,{65557,0}
1126
1127,{65557,0}
1128
1129},{
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
1143},{
1144
1145{3,1,21,24,21,24,0}
1146
1147,{0,1,9,1,0,0,0}
1148
1149,{0,1,9,1,0,0,0}
1150
1151,{6,17,0,34,30,0,65386}
1152
1153},{5,3,129,108,0,126,104,88}
1154
1155#else
1156
1157{1,8,76,32},{
1158
1159{20,0}
1160
1161,{100721941,256000}
1162
1163,{1048607509,256004}
1164
1165,{20,0}
1166
1167,{1048586773,256003}
1168
1169,{20,0}
1170
1171,{524291861,128001}
1172
1173,{20,0}
1174
1175,{524288021,128001}
1176
1177,{524293141,128001}
1178
1179,{20,0}
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
1197,{20,0}
1198
1199,{1024021,0}
1200
1201,{65557,0}
1202
1203,{65557,0}
1204
1205,{65557,0}
1206
1207},{
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
1221},{
1222
1223{24,21,1,3,0,24,21}
1224
1225,{1,9,1,0,0,0,0}
1226
1227,{1,9,1,0,0,0,0}
1228
1229,{34,0,17,6,65386,0,30}
1230
1231},{108,129,3,5,88,104,126,0}
1232
1233#endif
1234
1235/*fin_reglage*/
1236
1237
1238
1239},{
1240
1241
1242
1243/*debut reglage 4 */
1244
1245#ifdef programme
1246
1247{39,62,9,1},{
1248
1249{20,0}
1250
1251,{-100659180,229382}
1252
1253,{-100659436,294918}
1254
1255,{20,0}
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
1269,{20,0}
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
1289,{1024022,0}
1290
1291,{16406,0}
1292
1293,{4117,0}
1294
1295,{262164,0}
1296
1297},{
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
1311},{
1312
1313{0,1,9,1,0,0,0}
1314
1315,{0,1,9,1,0,0,0}
1316
1317,{0,1,9,1,0,0,0}
1318
1319,{0,1,9,1,0,0,0}
1320
1321},{2,3,129,108,2,126,104,88}
1322
1323#else
1324
1325{1,9,62,39},{
1326
1327{20,0}
1328
1329,{-100659180,229382}
1330
1331,{-100659436,294918}
1332
1333,{20,0}
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
1347,{20,0}
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
1367,{1024022,0}
1368
1369,{16406,0}
1370
1371,{4117,0}
1372
1373,{262164,0}
1374
1375},{
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
1389},{
1390
1391{1,9,1,0,0,0,0}
1392
1393,{1,9,1,0,0,0,0}
1394
1395,{1,9,1,0,0,0,0}
1396
1397,{1,9,1,0,0,0,0}
1398
1399},{108,129,3,2,88,104,126,2}
1400
1401#endif
1402
1403/*fin_reglage*/
1404
1405
1406
1407},{
1408
1409
1410
1411/*debut reglage 5 */
1412
1413#ifdef programme
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
1465},{
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
1479},{
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
1491#else
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
1543},{
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
1557},{
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
1569#endif
1570
1571/*fin_reglage*/
1572
1573
1574
1575},{
1576
1577
1578
1579/*debut reglage 6 */
1580
1581#ifdef programme
1582
1583{197,191,175,185},{
1584
1585{0,0}
1586
1587,{0,0}
1588
1589,{0,0}
1590
1591,{0,0}
1592
1593,{0,0}
1594
1595,{0,0}
1596
1597,{0,0}
1598
1599,{0,0}
1600
1601,{0,0}
1602
1603,{0,0}
1604
1605,{0,0}
1606
1607,{0,0}
1608
1609,{0,0}
1610
1611,{0,0}
1612
1613,{0,0}
1614
1615,{0,0}
1616
1617,{0,0}
1618
1619,{0,0}
1620
1621,{0,0}
1622
1623,{0,0}
1624
1625,{0,0}
1626
1627,{0,0}
1628
1629,{0,0}
1630
1631,{0,0}
1632
1633},{
1634
1635{106,98,93,71}
1636
1637,{66,74,87,66}
1638
1639,{48,46,38,33}
1640
1641,{40,41,33,26}
1642
1643,{25,29,40,57}
1644
1645,{63,62,71,80}
1646
1647},{
1648
1649{83,79,75,75,92,112,31100}
1650
1651,{125,126,117,113,107,94,20315}
1652
1653,{108,116,122,124,117,120,32117}
1654
1655,{110,99,94,98,107,93,17217}
1656
1657},{88,82,94,108,111,126,104,88}
1658
1659#else
1660
1661{185,175,191,197},{
1662
1663{0,0}
1664
1665,{0,0}
1666
1667,{0,0}
1668
1669,{0,0}
1670
1671,{0,0}
1672
1673,{0,0}
1674
1675,{0,0}
1676
1677,{0,0}
1678
1679,{0,0}
1680
1681,{0,0}
1682
1683,{0,0}
1684
1685,{0,0}
1686
1687,{0,0}
1688
1689,{0,0}
1690
1691,{0,0}
1692
1693,{0,0}
1694
1695,{0,0}
1696
1697,{0,0}
1698
1699,{0,0}
1700
1701,{0,0}
1702
1703,{0,0}
1704
1705,{0,0}
1706
1707,{0,0}
1708
1709,{0,0}
1710
1711},{
1712
1713{71,93,98,106}
1714
1715,{66,87,74,66}
1716
1717,{33,38,46,48}
1718
1719,{26,33,41,40}
1720
1721,{57,40,29,25}
1722
1723,{80,71,62,63}
1724
1725},{
1726
1727{75,75,79,83,31100,112,92}
1728
1729,{113,117,126,125,20315,94,107}
1730
1731,{124,122,116,108,32117,120,117}
1732
1733,{98,94,99,110,17217,93,107}
1734
1735},{108,94,82,88,88,104,126,111}
1736
1737#endif
1738
1739/*fin_reglage*/
1740
1741
1742
1743},{
1744
1745
1746
1747/*debut reglage 7 */
1748
1749#ifdef programme
1750
1751{197,191,175,185},{
1752
1753{0,0}
1754
1755,{0,0}
1756
1757,{0,0}
1758
1759,{0,0}
1760
1761,{0,0}
1762
1763,{0,0}
1764
1765,{0,0}
1766
1767,{0,0}
1768
1769,{0,0}
1770
1771,{0,0}
1772
1773,{0,0}
1774
1775,{0,0}
1776
1777,{0,0}
1778
1779,{0,0}
1780
1781,{0,0}
1782
1783,{0,0}
1784
1785,{0,0}
1786
1787,{0,0}
1788
1789,{0,0}
1790
1791,{0,0}
1792
1793,{0,0}
1794
1795,{0,0}
1796
1797,{0,0}
1798
1799,{0,0}
1800
1801},{
1802
1803{106,98,93,71}
1804
1805,{66,74,87,66}
1806
1807,{48,46,38,33}
1808
1809,{40,41,33,26}
1810
1811,{25,29,40,57}
1812
1813,{63,62,71,80}
1814
1815},{
1816
1817{83,79,75,75,92,112,31100}
1818
1819,{125,126,117,113,107,94,20315}
1820
1821,{108,116,122,124,117,120,32117}
1822
1823,{110,99,94,98,107,93,17217}
1824
1825},{88,82,94,108,111,126,104,88}
1826
1827#else
1828
1829{185,175,191,197},{
1830
1831{0,0}
1832
1833,{0,0}
1834
1835,{0,0}
1836
1837,{0,0}
1838
1839,{0,0}
1840
1841,{0,0}
1842
1843,{0,0}
1844
1845,{0,0}
1846
1847,{0,0}
1848
1849,{0,0}
1850
1851,{0,0}
1852
1853,{0,0}
1854
1855,{0,0}
1856
1857,{0,0}
1858
1859,{0,0}
1860
1861,{0,0}
1862
1863,{0,0}
1864
1865,{0,0}
1866
1867,{0,0}
1868
1869,{0,0}
1870
1871,{0,0}
1872
1873,{0,0}
1874
1875,{0,0}
1876
1877,{0,0}
1878
1879},{
1880
1881{71,93,98,106}
1882
1883,{66,87,74,66}
1884
1885,{33,38,46,48}
1886
1887,{26,33,41,40}
1888
1889,{57,40,29,25}
1890
1891,{80,71,62,63}
1892
1893},{
1894
1895{75,75,79,83,31100,112,92}
1896
1897,{113,117,126,125,20315,94,107}
1898
1899,{124,122,116,108,32117,120,117}
1900
1901,{98,94,99,110,17217,93,107}
1902
1903},{108,94,82,88,88,104,126,111}
1904
1905#endif
1906
1907/*fin_reglage*/
1908
1909
1910
1911} };
1912
1913
1914
1915/* ------------------------------------ corps des fonctions ------------------------------ */
1916
1917/* -------------------------------------------------------------------------------------------- */
1918
1919
1920
1921
1922
1923
1924
1925unsigned int4 val_long(char x)
1926
1927{
1928
1929unsigned long a,xl;
1930
1931char aa;
1932
1933aa=x-2;
1934
1935a=aa;
1936
1937if(x<3) xl=x; else xl=((a&1) + 2)<<(a>>1);
1938
1939return(xl);
1940
1941}
1942
1943
1944
1945
1946
1947double val_double(char x)
1948
1949{
1950
1951unsigned long a,xl;
1952
1953if(x<0) x=-x; a=x; if(!a) xl=0; else xl=((a&1) + 2)<<(a>>1);
1954
1955if(x>0) return(1e-4*(double)xl); else return(-1e-4*(double)xl);
1956
1957}
1958
1959
1960
1961int new_val_dac(int a,char code)
1962
1963{
1964
1965if(code&0x80) a=(code&0x7f) <<5 ;
1966
1967else {
1968
1969 if(code&0x40) a+=code&0x3f;
1970
1971 else a-=code&0x3f;
1972
1973 }
1974
1975return(a);
1976
1977}
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987int calcul_somme_block(block_type_modele* blk,int longueur)
1988
1989{
1990
1991int i,so=0;;
1992
1993for(i=0;i<(longueur/4-4);i++) so^=(int)blk->mot[i];
1994
1995/* somme sur tous les mots internes : on exclus le dbut, les codes et la fin */
1996
1997return((so^(so>>16))&0xffff);
1998
1999}
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009void valide_block(block_type_modele* blk,int type,int block_num)
2010
2011{
2012
2013int somme,longueur;
2014
2015def_long_block
2016
2017longueur=long_block[type];
2018
2019/*printf("valide block adresse %x type %d numblock %d longueur=%d \n" */
2020
2021/* ,(unsigned)blk,type,block_num,longueur);*/
2022
2023blk->debut = debut_block_mesure;
2024
2025somme=0;blk->code1 = (((long)longueur)<<16) | somme;
2026
2027blk->code2 = (((long)block_num) & 0xffffff ) | ( (((long)type)<<24)&0xff000000 );
2028
2029
2030
2031blk->mot[longueur/4-4] = fin_block_mesure;
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
2051somme=calcul_somme_block(blk,longueur);
2052
2053blk->code1 = (((long)longueur)<<16) | somme;
2054
2055/* l'ecc est faux car on a change la somme: mettre la somme a zero avant de tester ecc */
2056
2057}
2058
2059
2060
2061/* Quand on est sur une machine swappee, on ne cherche pas a verifier */
2062
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
2085int verifie_block(block_type_modele* blk)
2086
2087{
2088
2089int type,lg,som;
2090
2091def_long_block
2092
2093if(blk->debut != debut_block_mesure) return(block_debut_erreur);
2094
2095type=type_block(blk); if( (type<0) ||(type>=nb_type_blocks) ) return(block_type_inconnu);
2096
2097lg=longueur_block(blk); if( lg != long_block[type] ) return(block_longueur_erreur);
2098
2099if( blk->mot[(lg/4)-4] != fin_block_mesure) return(block_fin_erreur);
2100
2101#ifndef SWAP
2102
2103som=calcul_somme_block(blk,lg); if( som!= somme_block(blk)) return(block_somme_erreur);
2104
2105#endif
2106
2107return(block_correct);
2108
2109}
2110
2111
2112
2113
2114
2115int verifie_block_printf(block_type_modele* blk)
2116
2117{
2118
2119int type,lg,som;
2120
2121def_long_block
2122
2123def_nom_block
2124
2125if(blk->debut != debut_block_mesure)
2126
2127 {
2128
2129 printf(" erreur dans le code debut de block \n");
2130
2131 return(block_debut_erreur);
2132
2133 }
2134
2135
2136
2137type=type_block(blk);
2138
2139if( (type<0) || (type>nb_type_blocks) )
2140
2141 {
2142
2143 printf(" block de type %d inconnu\n",type);
2144
2145 return(block_type_inconnu);
2146
2147 }
2148
2149
2150
2151lg=longueur_block(blk);
2152
2153if( lg!=long_block[type] )
2154
2155 {
2156
2157 printf(" block type %s erreur de longueur (nominal=%d , dans le block=%d \n"
2158
2159 ,nom_block[type],long_block[type],lg);
2160
2161 return(block_longueur_erreur);
2162
2163 }
2164
2165
2166
2167som=calcul_somme_block(blk,lg);
2168
2169if( som!=somme_block(blk) )
2170
2171 {
2172
2173 printf(" block type %s : erreur de somme (calculee=%d , dans le block=%d \n"
2174
2175 ,nom_block[type],som,somme_block(blk) );
2176
2177 return(block_somme_erreur);
2178
2179 }
2180
2181
2182
2183if(blk->mot[(lg/4)-4] != fin_block_mesure)
2184
2185 {
2186
2187 printf(" block type %s erreur de code fin de block : trouve %x au lieu de %x \n"
2188
2189 ,nom_block[type],(int)blk->mot[(lg/4)-4],fin_block_mesure);
2190
2191 return(block_fin_erreur);
2192
2193 }
2194
2195
2196
2197return(block_correct);
2198
2199}
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
Note: See TracBrowser for help on using the repository browser.