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

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

archediab 25

File size: 18.3 KB
RevLine 
[637]1#include "manip.h"
2#include "archeops.h"
3
4
[639]5
[637]6/********** coefficients pour les mesures bolo ********************************/
7/* toutes les puissances en pW */
8/* -1- loi de reponse thermique des bolos avec R en ohms et T en Kelvin */
9/* */
10/* T = coef2 * ( ln ( R / coef1) ** ( -1 / coef0 ) */
11/* */
12/* -2- fuite thermique du bolo coef 3,4 */
13/* */
14/* Ptot = coef3 * ( (10*Tb) ** coef4 - (10*Tcryo) ** coef4 ) */
15/* */
16/* -3- calcul empirique de Pciel et de tau coef 5,6 */
17/* */
18/* Pciel = coef5 - Pelec coef5= I * Ai (tables xavier) */
19/* tau = - ln ( 1 + Pciel / coef6 ) coef6= I * Bi (tables xavier) */
20/* */
21/**************************************************************************************/
22
23
24/**************************************************************************************/
25/* */
26/* pour les MLPA : gain = 100 diviseur = 101 ou 330 */
27/* pour les bebodiff : gain = diviseur = 100Kohm / R preampli */
28/* pour les bebodiff : la capa est corrigee d'un facteur 0.868 */
29/* pour les cartes modifiees : mettre diviseur=0 */
30/* et capa = la resistance de chage en Megohm */
31/* */
32/**************************************************************************************/
33
34
[639]35/* nom , on/off , 0 = MLPA , N° bolo , gain_pa , capa*1000 , diviseur , coef*10000 */
36/* , 0 ou 1 , 2..8 = BEBO , hard , , 4700 , 333 , */
37/* 10 = Bediff , , , */
[637]38
[639]39/* pour les bediff (code 10) le n° de bolo est N° de bebo*8 + numero dans la bebo */
40/* soit : 1 2 3 4 5 6 .. 9 10 11 12 13 14 .. 17 18 19 20 21 22 .. etc */
[637]41
42
43/*debut_param*/
44/*---------------------------------- fenetre : -----------------------------------*/
45
[639]46param_bolo parametr={25,24,36,88,18,
[637]47
[639]48{
49{ "v1-bedif1" , 1,10,1 , 200, 22000 , 200, { 5000 , 123100 , 334200,0,0,0,0} },
50{ "v1-bedif2" , 1,10,2 , 200, 22000 , 200, { 500 , 136180 , 9010,0,0,0,0} },
51{ "v1-bedif3" , 1,10,3 , 200, 22000 , 200, { 500 , 136180 , 9010,0,0,0,0} },
52{ "v1-bedif4" , 1,10,4 , 200, 22000 , 200, { 5000 , 123100 , 334200,0,0,0,0} },
53{ "v1-bedif5" , 1,10,5 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
54{ "v1-bedif6" , 1,10,6 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[637]55
[639]56{ "v1-bedif7" , 1,10,9 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
57{ "v1-bedif8" , 1,10,10, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
58{ "v1-bedif9" , 1,10,11, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
59{ "v1-bedif10" , 1,10,12, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
60{ "v1-bedif11" , 1,10,13, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
61{ "v1-bedif12" , 1,10,14, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[637]62
[639]63{ "v1-bedif13" , 1,10,17, 1000, 100000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
64{ "v1-bedif14" , 1,10,18, 1000, 470000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
65{ "bedif15" , 1,10,19, 1000, 470000 , 1000, { 500 , 58800 , 12500,0,0,0,0} },
66{ "bedif16" , 1,10,20, 1000,2200000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
67{ "bedif17" , 1,10,21, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
68{ "bedif18" , 1,10,22, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
[637]69
[639]70{ "v1-bedif19" , 2,10,25, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
71{ "v1-bedif20" , 2,10,26, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
72{ "germanium" , 3,10,27, 1000, 22000 , 0, { 3500 , 17100 , 646500,0,0,0,0} },
73{ "therm_4k" , 3,10,28, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
74{ "therm_1.6k" , 3,10,29, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
75{ "therm_10k" , 3,10,30, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
[637]76
77}
78};
79/*fin_param*/
80
81
82
83/* bolos campagne 1998-1999 */
84/*
85reg_NbSi.J, 1, 0, 1, 100, 4.7, 333, .5 ,519.6 , 8.286
86v1-231...L, 1, 0, 2, 100, 4.7, 333, .5 , 1.7 , 32.41 , 0.333 , 10 , 20.30 , 11.41
87v1-232...N, 1, 0, 3, 100, 4.7, 333,
88v1-237...E, 1, 0, 4, 100, 4.7, 333,
89
90reg_JamieO, 1, 0, 5, 100, 4.7, 101,
91
92V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
93V2-230...B, 1, 0, 7, 100, 4.7, 333, .5 , 8.26 , 26.61 , 5.10 , 7 , 9.354 , 1.026
94V2-205...Q, 1, 0, 8, 100, 4.7, 333, .518 , 81 , 25.2
95V2-208...P, 1, 0, 9, 100, 4.7, 333, .5 , 12.31 , 33.42 , 0.627 , 6.5 , 8.113 , 2.958
96
97*/
98/*bolos campagne 1997-1998 */
99/*
100
101v1-208...J, 1, 0, 1, 100, 4.7, 333, .5 , 12.31 , 33.42
102v1-232...L, 1, 0, 2, 100, 4.7, 333,
103v1-205...N, 1, 0, 3, 100, 4.7, 333, .518 , 81 , 25.2
104v1-NbSi..E, 1, 0, 4, 100, 4.7, 333, .5 ,519.6 , 8.286
105Jamie....O, 1, 0, 5, 100, 4.7, 101,
106V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
107V2-224...B, 1, 0, 7, 100, 4.7, 333, .5 ,3.43 , 26.6
108V2-230...Q, 1, 0, 8, 100, 4.7, 333, .5 , 8.26 , 26.61
109V2-231...P, 1, 0, 9, 100, 4.7, 333, .5 , 1.7 , 32.41
110
111*/
112
113
114
115
116
117/*debut_nom_reglage*/
[639]118/* 0->a chaud complet*/
119/* 1->a froid pour V(I)*/
[637]120/* 2->cc*/
[639]121/* 3->a chaud complet*/
122/* 4->chaud avec synchro*/
[637]123/* 5->reglage 5 */
124/* 6->reglage 6 */
125/* 7->reglage 7 */
126/*fin_nom_reglage*/
127
128
129
130
131
132
133
[639]134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
[637]179reglage_bolo reglage_standard[8]={{
180
181
182/*debut reglage 0 */
[639]183#ifdef programme
[637]184{30,76,9,1},
185{0
186,10
187,1
[639]188,1
[637]189,10
[639]190,1
191,1
[637]192,0
193,0
194,0
195,0
196,0
[639]197,1
[637]198,0
199,0
200,0
201,0
202,0
203,0
204,0
205},{
[639]206{20,0}
207,{-1148225771,229380}
208,{-1148367339,294916}
[637]209,{20,0}
[639]210,{21,221185}
211,{21,0}
212,{21,245761}
[637]213,{20,0}
[639]214,{21,245761}
215,{277,253953}
216,{20,0}
217,{21,204801}
218,{21,19457}
219,{21,1}
220,{11501589,8708}
221,{20,0}
222,{-100647916,0}
223,{1015828,0}
224,{20,0}
225,{20,0}
226,{1024022,0}
227,{25622,0}
228,{-100395499,0}
229,{25622,0}
[637]230},{
[639]231{0,0,128,1}
232,{0,0,128,4}
233,{0,0,128,4}
234,{0,0,128,3}
235,{0,0,128,4}
236,{0,0,128,4}
[637]237},{
238{0,1,9,1,0,0,0}
239,{0,1,9,1,0,0,0}
240,{0,1,9,1,0,0,0}
241,{0,1,9,1,0,0,0}
[639]242},{1,3,129,108,3,126,104,88}
243#else
244{1,9,76,30},
245{1
246,1
247,10
248,0
249,0
250,1
251,1
252,10
253,0
254,0
255,0
256,0
257,0
258,0
259,0
260,1
261,0
262,0
263,0
264,0
265},{
266{20,0}
267,{-1148225771,229380}
268,{-1148367339,294916}
269,{20,0}
270,{21,221185}
271,{21,0}
272,{21,245761}
273,{20,0}
274,{21,245761}
275,{277,253953}
276,{20,0}
277,{21,204801}
278,{21,19457}
279,{21,1}
280,{11501589,8708}
281,{20,0}
282,{-100647916,0}
283,{1015828,0}
284,{20,0}
285,{20,0}
286,{1024022,0}
287,{25622,0}
288,{-100395499,0}
289,{25622,0}
290},{
291{1,128,0,0}
292,{4,128,0,0}
293,{4,128,0,0}
294,{3,128,0,0}
295,{4,128,0,0}
296,{4,128,0,0}
297},{
298{1,9,1,0,0,0,0}
299,{1,9,1,0,0,0,0}
300,{1,9,1,0,0,0,0}
301,{1,9,1,0,0,0,0}
302},{108,129,3,1,88,104,126,3}
303#endif
[637]304/*fin_reglage*/
305
306},{
307
308/*debut reglage 1 */
[639]309#ifdef programme
310{31,76,9,1},
[637]311{0
312,10
313,1
[639]314,1
[637]315,10
[639]316,1
[637]317,0
318,0
319,1
320,0
321,0
322,0
323,0
324,0
325,0
326,0
327,0
328,0
329,0
330,0
331},{
[639]332{20,0}
333,{-1148225771,229380}
334,{-1148367339,294916}
[637]335,{20,0}
[639]336,{2127959573,221185}
337,{21,0}
338,{2127892757,245761}
[637]339,{20,0}
[639]340,{2127991317,245761}
341,{2127996181,253953}
342,{20,0}
343,{2128584725,204801}
344,{2127780885,19457}
345,{2127795221,1}
346,{11501589,8708}
347,{20,0}
348,{-100647916,0}
349,{1015828,0}
350,{20,0}
351,{20,0}
352,{12822,0}
353,{25622,0}
354,{-100660714,0}
355,{25622,0}
[637]356},{
[639]357{2,21,25,1}
358,{0,20,0,4}
359,{0,20,0,4}
360,{0,21,23,3}
361,{0,20,0,4}
362,{0,20,0,4}
[637]363},{
364{0,1,9,1,0,0,0}
365,{0,1,9,1,0,0,0}
366,{0,1,9,1,0,0,0}
367,{0,1,9,1,0,0,0}
[639]368},{129,3,129,108,3,126,104,88}
369#else
370{1,9,76,31},
371{1
372,1
373,10
374,0
375,0
376,0
377,1
378,10
379,0
380,0
381,0
382,1
383,0
384,0
385,0
386,0
387,0
388,0
389,0
390,0
391},{
392{20,0}
393,{-1148225771,229380}
394,{-1148367339,294916}
395,{20,0}
396,{2127959573,221185}
397,{21,0}
398,{2127892757,245761}
399,{20,0}
400,{2127991317,245761}
401,{2127996181,253953}
402,{20,0}
403,{2128584725,204801}
404,{2127780885,19457}
405,{2127795221,1}
406,{11501589,8708}
407,{20,0}
408,{-100647916,0}
409,{1015828,0}
410,{20,0}
411,{20,0}
412,{12822,0}
413,{25622,0}
414,{-100660714,0}
415,{25622,0}
416},{
417{1,25,21,2}
418,{4,0,20,0}
419,{4,0,20,0}
420,{3,23,21,0}
421,{4,0,20,0}
422,{4,0,20,0}
423},{
424{1,9,1,0,0,0,0}
425,{1,9,1,0,0,0,0}
426,{1,9,1,0,0,0,0}
427,{1,9,1,0,0,0,0}
428},{108,129,3,129,88,104,126,3}
429#endif
[637]430/*fin_reglage*/
431
432},{
433
434/*debut reglage 2 */
[639]435#ifdef programme
436{197,191,175,185},
[637]437{0
[639]438,255
439,254
440,0
441,0
442,0
443,0
444,0
445,0
446,0
447,0
448,0
449,83
450,92
451,94
452,98
453,65
454,53
455,53
456,36
[637]457},{
[639]458{0,0}
[637]459,{0,0}
460,{0,0}
461,{0,0}
462,{0,0}
463,{0,0}
464,{0,0}
[639]465,{0,0}
466,{0,0}
467,{0,0}
468,{0,0}
469,{0,0}
470,{0,0}
471,{0,0}
472,{0,0}
473,{0,0}
474,{0,0}
475,{0,0}
476,{0,0}
477,{0,0}
478,{0,0}
479,{0,0}
480,{0,0}
481,{0,0}
[637]482},{
[639]483{106,98,93,71}
484,{66,74,87,66}
485,{48,46,38,33}
486,{40,41,33,26}
487,{25,29,40,57}
488,{63,62,71,80}
[637]489},{
[639]490{83,79,75,75,92,112,31100}
491,{125,126,117,113,107,94,20315}
492,{108,116,122,124,117,120,32117}
493,{110,99,94,98,107,93,17217}
494},{88,82,94,108,111,126,104,88}
495#else
496{185,175,191,197},
497{0
498,254
499,255
500,0
501,0
502,0
503,0
504,0
505,0
506,0
507,0
508,0
509,98
510,94
511,92
512,83
513,36
514,53
515,53
516,65
517},{
518{0,0}
519,{0,0}
520,{0,0}
521,{0,0}
522,{0,0}
523,{0,0}
524,{0,0}
525,{0,0}
526,{0,0}
527,{0,0}
528,{0,0}
529,{0,0}
530,{0,0}
531,{0,0}
532,{0,0}
533,{0,0}
534,{0,0}
535,{0,0}
536,{0,0}
537,{0,0}
538,{0,0}
539,{0,0}
540,{0,0}
541,{0,0}
542},{
543{71,93,98,106}
544,{66,87,74,66}
545,{33,38,46,48}
546,{26,33,41,40}
547,{57,40,29,25}
548,{80,71,62,63}
549},{
550{75,75,79,83,31100,112,92}
551,{113,117,126,125,20315,94,107}
552,{124,122,116,108,32117,120,117}
553,{98,94,99,110,17217,93,107}
554},{108,94,82,88,88,104,126,111}
555#endif
[637]556/*fin_reglage*/
557
558},{
559
560/*debut reglage 3 */
[639]561#ifdef programme
562{30,76,9,1},
[637]563{0
[639]564,10
[637]565,1
[639]566,1
567,10
568,1
569,0
570,0
571,0
572,0
573,0
574,0
575,1
576,0
577,0
578,0
579,0
580,0
581,0
582,0
[637]583},{
[639]584{20,0}
585,{-1149239274,229380}
586,{-1149239275,294916}
[637]587,{20,0}
[639]588,{20,221185}
589,{21,0}
590,{20,245761}
[637]591,{20,0}
[639]592,{20,245761}
593,{276,253953}
594,{20,0}
595,{20,204801}
596,{20,19457}
597,{20,1}
598,{10486037,8708}
599,{20,0}
600,{-100647916,0}
601,{1015828,0}
602,{20,0}
603,{20,0}
604,{1024022,0}
605,{25622,0}
606,{-100660714,0}
607,{25622,0}
[637]608},{
[639]609{0,20,0,1}
610,{0,20,0,4}
611,{0,20,0,4}
612,{2,20,0,3}
613,{0,20,0,4}
614,{0,20,0,4}
[637]615},{
[639]616{0,1,9,1,0,0,0}
617,{0,1,9,1,0,0,0}
618,{0,1,9,1,0,0,0}
619,{0,1,9,1,0,0,0}
620},{1,3,129,108,3,126,104,88}
621#else
622{1,9,76,30},
623{1
624,1
625,10
626,0
627,0
628,0
629,1
630,10
631,0
632,0
633,0
634,0
635,0
636,0
637,0
638,1
639,0
640,0
641,0
642,0
643},{
644{20,0}
645,{-1149239274,229380}
646,{-1149239275,294916}
647,{20,0}
648,{20,221185}
649,{21,0}
650,{20,245761}
651,{20,0}
652,{20,245761}
653,{276,253953}
654,{20,0}
655,{20,204801}
656,{20,19457}
657,{20,1}
658,{10486037,8708}
659,{20,0}
660,{-100647916,0}
661,{1015828,0}
662,{20,0}
663,{20,0}
664,{1024022,0}
665,{25622,0}
666,{-100660714,0}
667,{25622,0}
668},{
669{1,0,20,0}
670,{4,0,20,0}
671,{4,0,20,0}
672,{3,0,20,2}
673,{4,0,20,0}
674,{4,0,20,0}
675},{
676{1,9,1,0,0,0,0}
677,{1,9,1,0,0,0,0}
678,{1,9,1,0,0,0,0}
679,{1,9,1,0,0,0,0}
680},{108,129,3,1,88,104,126,3}
681#endif
[637]682/*fin_reglage*/
683
684},{
685
686/*debut reglage 4 */
[639]687#ifdef programme
688{30,76,9,1},
[637]689{0
[639]690,10
[637]691,1
[639]692,1
693,10
694,1
695,1
696,0
697,0
698,0
699,0
700,0
701,1
702,0
703,0
704,0
705,0
706,0
707,0
708,0
[637]709},{
[639]710{20,0}
711,{-1148225771,229380}
712,{-1148367339,294916}
[637]713,{20,0}
[639]714,{21,221185}
715,{21,0}
716,{21,245761}
[637]717,{20,0}
[639]718,{21,245761}
719,{277,253953}
720,{20,0}
721,{21,204801}
722,{21,19457}
723,{21,1}
724,{11501589,8708}
725,{20,0}
726,{-100647916,0}
727,{1015828,0}
728,{20,0}
729,{20,0}
730,{1024022,0}
731,{25622,0}
732,{-100395499,0}
733,{25622,0}
734},{
735{0,0,128,1}
736,{0,0,128,4}
737,{0,0,128,4}
738,{0,0,128,3}
739,{0,0,128,4}
740,{0,0,128,4}
741},{
742{0,1,9,1,0,0,0}
743,{0,1,9,1,0,0,0}
744,{0,1,9,1,0,0,0}
745,{0,1,9,1,0,0,0}
746},{1,3,129,108,3,126,104,88}
747#else
748{1,9,76,30},
749{1
750,1
751,10
752,0
753,0
754,1
755,1
756,10
757,0
758,0
759,0
760,0
761,0
762,0
763,0
764,1
765,0
766,0
767,0
768,0
769},{
770{20,0}
771,{-1148225771,229380}
772,{-1148367339,294916}
773,{20,0}
774,{21,221185}
775,{21,0}
776,{21,245761}
777,{20,0}
778,{21,245761}
779,{277,253953}
780,{20,0}
781,{21,204801}
782,{21,19457}
783,{21,1}
784,{11501589,8708}
785,{20,0}
786,{-100647916,0}
787,{1015828,0}
788,{20,0}
789,{20,0}
790,{1024022,0}
791,{25622,0}
792,{-100395499,0}
793,{25622,0}
794},{
795{1,128,0,0}
796,{4,128,0,0}
797,{4,128,0,0}
798,{3,128,0,0}
799,{4,128,0,0}
800,{4,128,0,0}
801},{
802{1,9,1,0,0,0,0}
803,{1,9,1,0,0,0,0}
804,{1,9,1,0,0,0,0}
805,{1,9,1,0,0,0,0}
806},{108,129,3,1,88,104,126,3}
807#endif
808/*fin_reglage*/
809
810},{
811
812/*debut reglage 5 */
813#ifdef programme
814{197,191,175,185},
815{0
816,255
817,254
818,0
819,0
820,0
821,0
822,0
823,0
824,0
825,0
826,0
827,83
828,92
829,94
830,98
831,65
832,53
833,53
834,36
835},{
836{0,0}
[637]837,{0,0}
838,{0,0}
839,{0,0}
840,{0,0}
841,{0,0}
842,{0,0}
[639]843,{0,0}
844,{0,0}
845,{0,0}
846,{0,0}
847,{0,0}
848,{0,0}
849,{0,0}
850,{0,0}
851,{0,0}
852,{0,0}
853,{0,0}
854,{0,0}
855,{0,0}
856,{0,0}
857,{0,0}
858,{0,0}
859,{0,0}
[637]860},{
[639]861{106,98,93,71}
862,{66,74,87,66}
863,{48,46,38,33}
864,{40,41,33,26}
865,{25,29,40,57}
866,{63,62,71,80}
[637]867},{
[639]868{83,79,75,75,92,112,31100}
869,{125,126,117,113,107,94,20315}
870,{108,116,122,124,117,120,32117}
871,{110,99,94,98,107,93,17217}
872},{88,82,94,108,111,126,104,88}
873#else
874{185,175,191,197},
875{0
876,254
877,255
878,0
879,0
880,0
881,0
882,0
883,0
884,0
885,0
886,0
887,98
888,94
889,92
890,83
891,36
892,53
893,53
894,65
895},{
896{0,0}
897,{0,0}
898,{0,0}
899,{0,0}
900,{0,0}
901,{0,0}
902,{0,0}
903,{0,0}
904,{0,0}
905,{0,0}
906,{0,0}
907,{0,0}
908,{0,0}
909,{0,0}
910,{0,0}
911,{0,0}
912,{0,0}
913,{0,0}
914,{0,0}
915,{0,0}
916,{0,0}
917,{0,0}
918,{0,0}
919,{0,0}
920},{
921{71,93,98,106}
922,{66,87,74,66}
923,{33,38,46,48}
924,{26,33,41,40}
925,{57,40,29,25}
926,{80,71,62,63}
927},{
928{75,75,79,83,31100,112,92}
929,{113,117,126,125,20315,94,107}
930,{124,122,116,108,32117,120,117}
931,{98,94,99,110,17217,93,107}
932},{108,94,82,88,88,104,126,111}
933#endif
[637]934/*fin_reglage*/
935
936},{
937
[639]938/*debut reglage 6 */
939#ifdef programme
940{197,191,175,185},
[637]941{0
[639]942,255
943,254
944,0
945,0
946,0
947,0
948,0
949,0
950,0
951,0
952,0
953,83
954,92
955,94
956,98
957,65
958,53
959,53
960,36
[637]961},{
[639]962{0,0}
[637]963,{0,0}
964,{0,0}
965,{0,0}
966,{0,0}
967,{0,0}
968,{0,0}
[639]969,{0,0}
970,{0,0}
971,{0,0}
972,{0,0}
973,{0,0}
974,{0,0}
975,{0,0}
976,{0,0}
977,{0,0}
978,{0,0}
979,{0,0}
980,{0,0}
981,{0,0}
982,{0,0}
983,{0,0}
984,{0,0}
985,{0,0}
[637]986},{
[639]987{106,98,93,71}
988,{66,74,87,66}
989,{48,46,38,33}
990,{40,41,33,26}
991,{25,29,40,57}
992,{63,62,71,80}
[637]993},{
[639]994{83,79,75,75,92,112,31100}
995,{125,126,117,113,107,94,20315}
996,{108,116,122,124,117,120,32117}
997,{110,99,94,98,107,93,17217}
998},{88,82,94,108,111,126,104,88}
999#else
1000{185,175,191,197},
1001{0
1002,254
1003,255
1004,0
1005,0
1006,0
1007,0
1008,0
1009,0
1010,0
1011,0
1012,0
1013,98
1014,94
1015,92
1016,83
1017,36
1018,53
1019,53
1020,65
[637]1021},{
[639]1022{0,0}
1023,{0,0}
1024,{0,0}
1025,{0,0}
1026,{0,0}
1027,{0,0}
1028,{0,0}
1029,{0,0}
1030,{0,0}
1031,{0,0}
1032,{0,0}
1033,{0,0}
1034,{0,0}
1035,{0,0}
1036,{0,0}
1037,{0,0}
1038,{0,0}
1039,{0,0}
1040,{0,0}
1041,{0,0}
1042,{0,0}
1043,{0,0}
1044,{0,0}
1045,{0,0}
1046},{
1047{71,93,98,106}
1048,{66,87,74,66}
1049,{33,38,46,48}
1050,{26,33,41,40}
1051,{57,40,29,25}
1052,{80,71,62,63}
1053},{
1054{75,75,79,83,31100,112,92}
1055,{113,117,126,125,20315,94,107}
1056,{124,122,116,108,32117,120,117}
1057,{98,94,99,110,17217,93,107}
1058},{108,94,82,88,88,104,126,111}
1059#endif
[637]1060/*fin_reglage*/
1061
1062},{
1063
1064/*debut reglage 7 */
[639]1065#ifdef programme
1066{197,191,175,185},
1067{0
1068,255
1069,254
1070,0
1071,0
1072,0
1073,0
1074,0
1075,0
1076,0
1077,0
1078,0
1079,83
1080,92
1081,94
1082,98
1083,65
1084,53
1085,53
1086,36
1087},{
1088{0,0}
1089,{0,0}
1090,{0,0}
1091,{0,0}
1092,{0,0}
1093,{0,0}
1094,{0,0}
1095,{0,0}
1096,{0,0}
1097,{0,0}
1098,{0,0}
1099,{0,0}
1100,{0,0}
1101,{0,0}
1102,{0,0}
1103,{0,0}
1104,{0,0}
1105,{0,0}
1106,{0,0}
1107,{0,0}
1108,{0,0}
1109,{0,0}
1110,{0,0}
1111,{0,0}
1112},{
1113{106,98,93,71}
1114,{66,74,87,66}
1115,{48,46,38,33}
1116,{40,41,33,26}
1117,{25,29,40,57}
1118,{63,62,71,80}
1119},{
1120{83,79,75,75,92,112,31100}
1121,{125,126,117,113,107,94,20315}
1122,{108,116,122,124,117,120,32117}
1123,{110,99,94,98,107,93,17217}
1124},{88,82,94,108,111,126,104,88}
1125#else
1126{185,175,191,197},
1127{0
1128,254
1129,255
1130,0
1131,0
1132,0
1133,0
1134,0
1135,0
1136,0
1137,0
1138,0
1139,98
1140,94
1141,92
1142,83
1143,36
1144,53
1145,53
1146,65
1147},{
1148{0,0}
1149,{0,0}
1150,{0,0}
1151,{0,0}
1152,{0,0}
1153,{0,0}
1154,{0,0}
1155,{0,0}
1156,{0,0}
1157,{0,0}
1158,{0,0}
1159,{0,0}
1160,{0,0}
1161,{0,0}
1162,{0,0}
1163,{0,0}
1164,{0,0}
1165,{0,0}
1166,{0,0}
1167,{0,0}
1168,{0,0}
1169,{0,0}
1170,{0,0}
1171,{0,0}
1172},{
1173{71,93,98,106}
1174,{66,87,74,66}
1175,{33,38,46,48}
1176,{26,33,41,40}
1177,{57,40,29,25}
1178,{80,71,62,63}
1179},{
1180{75,75,79,83,31100,112,92}
1181,{113,117,126,125,20315,94,107}
1182,{124,122,116,108,32117,120,117}
1183,{98,94,99,110,17217,93,107}
1184},{108,94,82,88,88,104,126,111}
1185#endif
[637]1186/*fin_reglage*/
1187
1188} };
1189
1190/* ------------------------------------ corps des fonctions ------------------------------ */
1191/* -------------------------------------------------------------------------------------------- */
1192
1193
1194
1195unsigned long val_long(char x)
1196{
1197unsigned long a,xl;
[639]1198char aa;
1199aa=x-2;
1200a=aa;
1201if(x<3) xl=x; else xl=((a&1) + 2)<<(a>>1);
[637]1202return(xl);
1203}
1204
1205
1206double val_double(char x)
1207{
1208unsigned long a,xl;
1209if(x<0) x=-x; a=x; if(!a) xl=0; else xl=((a&1) + 2)<<(a>>1);
1210if(x>0) return(1e-4*(double)xl); else return(-1e-4*(double)xl);
1211}
1212
1213int new_val_dac(int a,char code)
1214{
1215if(code&0x80) a=(code&0x7f) <<5 ;
1216else {
1217 if(code&0x40) a+=code&0x3f;
1218 else a-=code&0x3f;
1219 }
1220return(a);
1221}
1222
1223
1224
1225
1226int calcul_somme_block(block_type_modele* blk,int longueur)
1227{
1228int i,so=0;;
1229for(i=0;i<(longueur/4-4);i++) so^=(int)blk->mot[i];
1230/* somme sur tous les mots internes : on exclus le dbut, les codes et la fin */
1231return((so^(so>>16))&0xffff);
1232}
1233
1234
1235
1236
1237void valide_block(block_type_modele* blk,int type,int block_num)
1238{
1239int somme,longueur;
1240def_long_block
1241longueur=long_block[type];
1242/*printf("valide block adresse %x type %d numblock %d longueur=%d \n" */
1243/* ,(unsigned)blk,type,block_num,longueur);*/
1244blk->debut = debut_block_mesure;
1245blk->code2 = (((long)block_num) & 0xffffff ) | ( (((long)type)<<24)&0xff000000 );
1246
1247blk->mot[longueur/4-4] = fin_block_mesure;
1248somme=calcul_somme_block(blk,longueur);
1249blk->code1 = (((long)longueur)<<16) | somme;
1250}
1251
1252
[639]1253/* Quand on est sur une machine swappee, on ne cherche pas a verifier */
1254/* le checksum, puisqu'on a modifie les blocs, sans swapper par exemple */
1255/* les chars des noms de bolometres et des chaines GPS... */
1256#ifdef __alpha
1257#define SWAP
1258#endif
1259#if defined(Linux) || defined(linux)
1260#define SWAP
1261#endif
[637]1262
1263
1264int verifie_block(block_type_modele* blk)
1265{
1266int type,lg,som;
1267def_long_block
1268if(blk->debut != debut_block_mesure) return(block_debut_erreur);
1269type=type_block(blk); if( (type<0) ||(type>=nb_type_blocks) ) return(block_type_inconnu);
1270lg=longueur_block(blk); if( lg != long_block[type] ) return(block_longueur_erreur);
1271if( blk->mot[(lg/4)-4] != fin_block_mesure) return(block_fin_erreur);
[639]1272#ifndef SWAP
[637]1273som=calcul_somme_block(blk,lg); if( som!= somme_block(blk)) return(block_somme_erreur);
[639]1274#endif
[637]1275return(block_correct);
1276}
1277
1278
1279int verifie_block_printf(block_type_modele* blk)
1280{
1281int type,lg,som;
1282def_long_block
1283def_nom_block
1284if(blk->debut != debut_block_mesure)
1285 {
1286 printf(" erreur dans le code debut de block \n");
1287 return(block_debut_erreur);
1288 }
1289
1290type=type_block(blk);
1291if( (type<0) || (type>nb_type_blocks) )
1292 {
1293 printf(" block de type %d inconnu\n",type);
1294 return(block_type_inconnu);
1295 }
1296
1297lg=longueur_block(blk);
1298if( lg!=long_block[type] )
1299 {
1300 printf(" block type %s erreur de longueur (nominal=%d , dans le block=%d \n"
1301 ,nom_block[type],long_block[type],lg);
1302 return(block_longueur_erreur);
1303 }
1304
1305som=calcul_somme_block(blk,lg);
1306if( som!=somme_block(blk) )
1307 {
1308 printf(" block type %s : erreur de somme (calculee=%d , dans le block=%d \n"
1309 ,nom_block[type],som,somme_block(blk) );
1310 return(block_somme_erreur);
1311 }
1312
1313if(blk->mot[(lg/4)-4] != fin_block_mesure)
1314 {
1315 printf(" block type %s erreur de code fin de block : trouve %x au lieu de %x \n"
1316 ,nom_block[type],(int)blk->mot[(lg/4)-4],fin_block_mesure);
1317 return(block_fin_erreur);
1318 }
1319
1320return(block_correct);
1321}
1322
1323
1324
1325
1326
Note: See TracBrowser for help on using the repository browser.