source: Sophya/trunk/Poubelle/archTOI.old/archeops_25.c@ 626

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

archtoi 2 aout 99

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