source: Sophya/trunk/Poubelle/archTOI.old/archeops_26.c@ 4086

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

archtoi 2 aout 99

File size: 18.7 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={26,24,36,88,18,
50
51{
52{ 1 , 0,10,1 , 200, 22000 , 200 },
53{ 2 , 1,10,2 , 200, 22000 , 200 },
54{ 3 , 1,10,3 , 200, 22000 , 200 },
55{ 4 , 0,10,4 , 200, 22000 , 200 },
56
57{ 5 , 1,10,5 , 1000, 4700 , 1000 },
58{ 6 , 0,10,6 , 1000, 4700 , 1000 },
59{ 7 , 1,10,9 , 1000, 4700 , 1000 },
60{ 8 , 0,10,10, 1000, 4700 , 1000 },
61
62{ 9 , 1,10,11, 1000, 4700 , 1000 },
63{ 10 , 1,10,12, 1000, 4700 , 1000 },
64{ 11 , 1,10,13, 1000, 4700 , 1000 },
65{ 12 , 1,10,14, 1000, 4700 , 1000 },
66
67{ 13 , 1,10,17, 1000, 4700 , 1000 },
68{ 14 , 1,10,18, 1000, 4700 , 1000 },
69{ 15 , 1,10,19, 1000, 4700 , 1000 },
70{ 16 , 1,10,20, 1000, 4700 , 1000 },
71
72{ 17 , 1,10,21, 500, 22000 , 500 },
73{ 18 , 1,10,22, 500, 22000 , 500 },
74{ 19 , 1,10,25, 500, 22000 , 500 },
75{ 20 , 1,10,26, 500, 22000 , 500 },
76
77{ 21 , 3,10,27, 1000, 22000 , 0 },
78{ 22 , 3,10,28, 1000, 1000 , 0 },
79{ 23 , 3,10,29, 1000, 1000 , 0 },
80{ 0 , 3,10,30, 1000, 1000 , 0 },
81
82},
83{
84{ "therm_10k" , {12000 ,1804000 , 72800,0,0,0,0} },
85{ "v1-bedif1" , { 5000 , 123100 , 334200,0,0,0,0} },
86{ "v1-bedif2" , { 5000 , 123100 , 334200,0,0,0,0} },
87{ "v1-bedif3" , { 5000 , 123100 , 334200,0,0,0,0} },
88{ "v1-bedif4" , { 5000 , 123100 , 334200,0,0,0,0} },
89
90{ "v1-bedif5" , { 5000 , 123100 , 334200,0,0,0,0} },
91{ "v1-bedif6" , { 5000 , 123100 , 334200,0,0,0,0} },
92{ "v1-bedif7" , { 5000 , 123100 , 334200,0,0,0,0} },
93{ "v1-bedif8" , { 5000 , 123100 , 334200,0,0,0,0} },
94
95{ "v1-bedif9" , { 5000 , 123100 , 334200,0,0,0,0} },
96{ "v1-bedif10" , { 5000 , 123100 , 334200,0,0,0,0} },
97{ "v1-bedif11" , { 5000 , 123100 , 334200,0,0,0,0} },
98{ "v1-bedif12" , { 5000 , 123100 , 334200,0,0,0,0} },
99
100{ "v1-bedif13" , { 5000 , 123100 , 334200,0,0,0,0} },
101{ "v1-bedif14" , { 5000 , 123100 , 334200,0,0,0,0} },
102{ "bedif15" , { 500 , 58800 , 12500,0,0,0,0} },
103{ "bedif16" , { 5000 , 123100 , 334200,0,0,0,0} },
104
105{ "bedif17" , { 5000 , 123100 , 334200,0,0,0,0} },
106{ "bedif18" , { 5000 , 123100 , 334200,0,0,0,0} },
107{ "v1-bedif19" , { 5000 , 123100 , 334200,0,0,0,0} },
108{ "v1-bedif20" , { 5000 , 123100 , 334200,0,0,0,0} },
109
110{ "germanium" , { 3500 , 17100 , 646500,0,0,0,0} },
111{ "therm_4k" , {12000 ,1804000 , 72800,0,0,0,0} },
112{ "therm_1.6k" , {12000 ,1804000 , 72800,0,0,0,0} },
113
114}
115
116};
117/*fin_param*/
118
119
120
121/* bolos campagne 1998-1999 */
122/*
123reg_NbSi.J, 1, 0, 1, 100, 4.7, 333, .5 ,519.6 , 8.286
124v1-231...L, 1, 0, 2, 100, 4.7, 333, .5 , 1.7 , 32.41 , 0.333 , 10 , 20.30 , 11.41
125v1-232...N, 1, 0, 3, 100, 4.7, 333,
126v1-237...E, 1, 0, 4, 100, 4.7, 333,
127
128reg_JamieO, 1, 0, 5, 100, 4.7, 101,
129
130V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
131V2-230...B, 1, 0, 7, 100, 4.7, 333, .5 , 8.26 , 26.61 , 5.10 , 7 , 9.354 , 1.026
132V2-205...Q, 1, 0, 8, 100, 4.7, 333, .518 , 81 , 25.2
133V2-208...P, 1, 0, 9, 100, 4.7, 333, .5 , 12.31 , 33.42 , 0.627 , 6.5 , 8.113 , 2.958
134
135*/
136/*bolos campagne 1997-1998 */
137/*
138
139v1-208...J, 1, 0, 1, 100, 4.7, 333, .5 , 12.31 , 33.42
140v1-232...L, 1, 0, 2, 100, 4.7, 333,
141v1-205...N, 1, 0, 3, 100, 4.7, 333, .518 , 81 , 25.2
142v1-NbSi..E, 1, 0, 4, 100, 4.7, 333, .5 ,519.6 , 8.286
143Jamie....O, 1, 0, 5, 100, 4.7, 101,
144V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
145V2-224...B, 1, 0, 7, 100, 4.7, 333, .5 ,3.43 , 26.6
146V2-230...Q, 1, 0, 8, 100, 4.7, 333, .5 , 8.26 , 26.61
147V2-231...P, 1, 0, 9, 100, 4.7, 333, .5 , 1.7 , 32.41
148
149*/
150
151
152int mode_transmission_telemesure[nb_modes_telemesure][nb_type_blocks]= {
153
154/* enregisteur de bord flash : plafond standard nominal */
155/* 0*/ { 0,10,15,50, 10,50, 0, 0, 0, 0, 0, 0, 1, 1, 1,2500, 0, 0, 0, 0},
156
157/* 1*/ { 0,10,10, 1, 10, 3, 0, 0, 0, 0, 0, 0, 1, 1, 4,2500, 0, 0, 0, 0},
158
159/* 2*/ { 0,10,05,01, 10,06, 0, 0, 0, 0, 0, 0, 1, 1, 2,2500, 0, 0, 0, 0},
160
161/* 3*/ { 0,10, 1,25, 10, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0},
162
163/* 4*/ { 0,10,15,50, 10,25, 0, 0, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
164
165/* 5*/ { 0,10,15,50, 10,25, 0, 0, 0, 0, 1, 0, 0, 0, 0,2500, 0, 0, 0, 0},
166
167/* 6*/ { 0,10,15,50, 10,50, 0, 0, 0, 1, 0, 0, 1, 0, 2,2500, 0, 0, 0, 0},
168
169/* 7*/ { 0,10,15,50,100,50,1, 1, 0, 0, 0, 0, 1, 1, 1,2500, 0, 0, 0, 0},
170
171/* 8*/ { 0,10,15,50,100,50,1, 1, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
172
173/* 9*/ { 0,10, 1, 1,100, 1,0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0}
174
175 };
176
177
178
179int mode_transmission_flash[nb_modes_flash][nb_type_blocks]= {
180
181
182/* enregisteur de bord flash : nominal */
183/* 0*/ { 0,50,15,25, 10,25, 0, 0, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0} ,
184
185/* enregisteur de bord flash : minimum */
186/* 1*/ { 0,50,50,50,50,100, 0, 0, 0, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0} ,
187
188/* enregisteur de bord flash : rien */
189/* 2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} };
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209/*debut_nom_reglage*/
210/* 0->a chaud complet*/
211/* 1->a froid pour V(I)*/
212/* 2->cc*/
213/* 3->a chaud complet*/
214/* 4->chaud avec synchro*/
215/* 5->reglage 5 */
216/* 6->reglage 6 */
217/* 7->reglage 7 */
218/*fin_nom_reglage*/
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271reglage_bolo reglage_standard[8]={{
272
273
274/*debut reglage 0 */
275#ifdef programme
276{30,76,9,1},{
277{20,0}
278,{-1148225771,229380}
279,{-1148367339,294916}
280,{20,0}
281,{21,221185}
282,{21,0}
283,{21,245761}
284,{20,0}
285,{21,245761}
286,{277,253953}
287,{20,0}
288,{21,204801}
289,{21,19457}
290,{21,1}
291,{11501589,8708}
292,{20,0}
293,{-100647916,0}
294,{1015828,0}
295,{20,0}
296,{20,0}
297,{1024022,0}
298,{25622,0}
299,{-100395499,0}
300,{25622,0}
301},{
302{0,0,128,1}
303,{0,0,128,4}
304,{0,0,128,4}
305,{0,0,128,3}
306,{0,0,128,4}
307,{0,0,128,4}
308},{
309{0,1,9,1,0,0,0}
310,{0,1,9,1,0,0,0}
311,{0,1,9,1,0,0,0}
312,{0,1,9,1,0,0,0}
313},{1,3,129,108,3,126,104,88}
314#else
315{1,9,76,30},{
316{20,0}
317,{-1148225771,229380}
318,{-1148367339,294916}
319,{20,0}
320,{21,221185}
321,{21,0}
322,{21,245761}
323,{20,0}
324,{21,245761}
325,{277,253953}
326,{20,0}
327,{21,204801}
328,{21,19457}
329,{21,1}
330,{11501589,8708}
331,{20,0}
332,{-100647916,0}
333,{1015828,0}
334,{20,0}
335,{20,0}
336,{1024022,0}
337,{25622,0}
338,{-100395499,0}
339,{25622,0}
340},{
341{1,128,0,0}
342,{4,128,0,0}
343,{4,128,0,0}
344,{3,128,0,0}
345,{4,128,0,0}
346,{4,128,0,0}
347},{
348{1,9,1,0,0,0,0}
349,{1,9,1,0,0,0,0}
350,{1,9,1,0,0,0,0}
351,{1,9,1,0,0,0,0}
352},{108,129,3,1,88,104,126,3}
353#endif
354/*fin_reglage*/
355
356},{
357
358/*debut reglage 1 */
359#ifdef programme
360{31,76,9,1},{
361{20,0}
362,{-1148225771,229380}
363,{-1148367339,294916}
364,{20,0}
365,{2127959573,221185}
366,{21,0}
367,{2127892757,245761}
368,{20,0}
369,{2127991317,245761}
370,{2127996181,253953}
371,{20,0}
372,{2128584725,204801}
373,{2127780885,19457}
374,{2127795221,1}
375,{11501589,8708}
376,{20,0}
377,{-100647916,0}
378,{1015828,0}
379,{20,0}
380,{20,0}
381,{12822,0}
382,{25622,0}
383,{-100660714,0}
384,{25622,0}
385},{
386{2,21,25,1}
387,{0,20,0,4}
388,{0,20,0,4}
389,{0,21,23,3}
390,{0,20,0,4}
391,{0,20,0,4}
392},{
393{0,1,9,1,0,0,0}
394,{0,1,9,1,0,0,0}
395,{0,1,9,1,0,0,0}
396,{0,1,9,1,0,0,0}
397},{129,3,129,108,3,126,104,88}
398#else
399{1,9,76,31},{
400{20,0}
401,{-1148225771,229380}
402,{-1148367339,294916}
403,{20,0}
404,{2127959573,221185}
405,{21,0}
406,{2127892757,245761}
407,{20,0}
408,{2127991317,245761}
409,{2127996181,253953}
410,{20,0}
411,{2128584725,204801}
412,{2127780885,19457}
413,{2127795221,1}
414,{11501589,8708}
415,{20,0}
416,{-100647916,0}
417,{1015828,0}
418,{20,0}
419,{20,0}
420,{12822,0}
421,{25622,0}
422,{-100660714,0}
423,{25622,0}
424},{
425{1,25,21,2}
426,{4,0,20,0}
427,{4,0,20,0}
428,{3,23,21,0}
429,{4,0,20,0}
430,{4,0,20,0}
431},{
432{1,9,1,0,0,0,0}
433,{1,9,1,0,0,0,0}
434,{1,9,1,0,0,0,0}
435,{1,9,1,0,0,0,0}
436},{108,129,3,129,88,104,126,3}
437#endif
438/*fin_reglage*/
439
440},{
441
442/*debut reglage 2 */
443#ifdef programme
444{197,191,175,185},{
445{0,0}
446,{0,0}
447,{0,0}
448,{0,0}
449,{0,0}
450,{0,0}
451,{0,0}
452,{0,0}
453,{0,0}
454,{0,0}
455,{0,0}
456,{0,0}
457,{0,0}
458,{0,0}
459,{0,0}
460,{0,0}
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},{
470{106,98,93,71}
471,{66,74,87,66}
472,{48,46,38,33}
473,{40,41,33,26}
474,{25,29,40,57}
475,{63,62,71,80}
476},{
477{83,79,75,75,92,112,31100}
478,{125,126,117,113,107,94,20315}
479,{108,116,122,124,117,120,32117}
480,{110,99,94,98,107,93,17217}
481},{88,82,94,108,111,126,104,88}
482#else
483{185,175,191,197},{
484{0,0}
485,{0,0}
486,{0,0}
487,{0,0}
488,{0,0}
489,{0,0}
490,{0,0}
491,{0,0}
492,{0,0}
493,{0,0}
494,{0,0}
495,{0,0}
496,{0,0}
497,{0,0}
498,{0,0}
499,{0,0}
500,{0,0}
501,{0,0}
502,{0,0}
503,{0,0}
504,{0,0}
505,{0,0}
506,{0,0}
507,{0,0}
508},{
509{71,93,98,106}
510,{66,87,74,66}
511,{33,38,46,48}
512,{26,33,41,40}
513,{57,40,29,25}
514,{80,71,62,63}
515},{
516{75,75,79,83,31100,112,92}
517,{113,117,126,125,20315,94,107}
518,{124,122,116,108,32117,120,117}
519,{98,94,99,110,17217,93,107}
520},{108,94,82,88,88,104,126,111}
521#endif
522/*fin_reglage*/
523
524},{
525
526/*debut reglage 3 */
527#ifdef programme
528{30,76,9,1},{
529{20,0}
530,{-1149239274,229380}
531,{-1149239275,294916}
532,{20,0}
533,{20,221185}
534,{21,0}
535,{20,245761}
536,{20,0}
537,{20,245761}
538,{276,253953}
539,{20,0}
540,{20,204801}
541,{20,19457}
542,{20,1}
543,{10486037,8708}
544,{20,0}
545,{-100647916,0}
546,{1015828,0}
547,{20,0}
548,{20,0}
549,{1024022,0}
550,{25622,0}
551,{-100660714,0}
552,{25622,0}
553},{
554{0,20,0,1}
555,{0,20,0,4}
556,{0,20,0,4}
557,{2,20,0,3}
558,{0,20,0,4}
559,{0,20,0,4}
560},{
561{0,1,9,1,0,0,0}
562,{0,1,9,1,0,0,0}
563,{0,1,9,1,0,0,0}
564,{0,1,9,1,0,0,0}
565},{1,3,129,108,3,126,104,88}
566#else
567{1,9,76,30},{
568{20,0}
569,{-1149239274,229380}
570,{-1149239275,294916}
571,{20,0}
572,{20,221185}
573,{21,0}
574,{20,245761}
575,{20,0}
576,{20,245761}
577,{276,253953}
578,{20,0}
579,{20,204801}
580,{20,19457}
581,{20,1}
582,{10486037,8708}
583,{20,0}
584,{-100647916,0}
585,{1015828,0}
586,{20,0}
587,{20,0}
588,{1024022,0}
589,{25622,0}
590,{-100660714,0}
591,{25622,0}
592},{
593{1,0,20,0}
594,{4,0,20,0}
595,{4,0,20,0}
596,{3,0,20,2}
597,{4,0,20,0}
598,{4,0,20,0}
599},{
600{1,9,1,0,0,0,0}
601,{1,9,1,0,0,0,0}
602,{1,9,1,0,0,0,0}
603,{1,9,1,0,0,0,0}
604},{108,129,3,1,88,104,126,3}
605#endif
606/*fin_reglage*/
607
608},{
609
610/*debut reglage 4 */
611#ifdef programme
612{30,76,9,1},{
613{20,0}
614,{-1148225771,229380}
615,{-1148367339,294916}
616,{20,0}
617,{21,221185}
618,{21,0}
619,{21,245761}
620,{20,0}
621,{21,245761}
622,{277,253953}
623,{20,0}
624,{21,204801}
625,{21,19457}
626,{21,1}
627,{11501589,8708}
628,{20,0}
629,{-100647916,0}
630,{1015828,0}
631,{20,0}
632,{20,0}
633,{1024022,0}
634,{25622,0}
635,{-100395499,0}
636,{25622,0}
637},{
638{0,0,128,1}
639,{0,0,128,4}
640,{0,0,128,4}
641,{0,0,128,3}
642,{0,0,128,4}
643,{0,0,128,4}
644},{
645{0,1,9,1,0,0,0}
646,{0,1,9,1,0,0,0}
647,{0,1,9,1,0,0,0}
648,{0,1,9,1,0,0,0}
649},{1,3,129,108,3,126,104,88}
650#else
651{1,9,76,30},{
652{20,0}
653,{-1148225771,229380}
654,{-1148367339,294916}
655,{20,0}
656,{21,221185}
657,{21,0}
658,{21,245761}
659,{20,0}
660,{21,245761}
661,{277,253953}
662,{20,0}
663,{21,204801}
664,{21,19457}
665,{21,1}
666,{11501589,8708}
667,{20,0}
668,{-100647916,0}
669,{1015828,0}
670,{20,0}
671,{20,0}
672,{1024022,0}
673,{25622,0}
674,{-100395499,0}
675,{25622,0}
676},{
677{1,128,0,0}
678,{4,128,0,0}
679,{4,128,0,0}
680,{3,128,0,0}
681,{4,128,0,0}
682,{4,128,0,0}
683},{
684{1,9,1,0,0,0,0}
685,{1,9,1,0,0,0,0}
686,{1,9,1,0,0,0,0}
687,{1,9,1,0,0,0,0}
688},{108,129,3,1,88,104,126,3}
689#endif
690/*fin_reglage*/
691
692},{
693
694/*debut reglage 5 */
695#ifdef programme
696{197,191,175,185},{
697{0,0}
698,{0,0}
699,{0,0}
700,{0,0}
701,{0,0}
702,{0,0}
703,{0,0}
704,{0,0}
705,{0,0}
706,{0,0}
707,{0,0}
708,{0,0}
709,{0,0}
710,{0,0}
711,{0,0}
712,{0,0}
713,{0,0}
714,{0,0}
715,{0,0}
716,{0,0}
717,{0,0}
718,{0,0}
719,{0,0}
720,{0,0}
721},{
722{106,98,93,71}
723,{66,74,87,66}
724,{48,46,38,33}
725,{40,41,33,26}
726,{25,29,40,57}
727,{63,62,71,80}
728},{
729{83,79,75,75,92,112,31100}
730,{125,126,117,113,107,94,20315}
731,{108,116,122,124,117,120,32117}
732,{110,99,94,98,107,93,17217}
733},{88,82,94,108,111,126,104,88}
734#else
735{185,175,191,197},{
736{0,0}
737,{0,0}
738,{0,0}
739,{0,0}
740,{0,0}
741,{0,0}
742,{0,0}
743,{0,0}
744,{0,0}
745,{0,0}
746,{0,0}
747,{0,0}
748,{0,0}
749,{0,0}
750,{0,0}
751,{0,0}
752,{0,0}
753,{0,0}
754,{0,0}
755,{0,0}
756,{0,0}
757,{0,0}
758,{0,0}
759,{0,0}
760},{
761{71,93,98,106}
762,{66,87,74,66}
763,{33,38,46,48}
764,{26,33,41,40}
765,{57,40,29,25}
766,{80,71,62,63}
767},{
768{75,75,79,83,31100,112,92}
769,{113,117,126,125,20315,94,107}
770,{124,122,116,108,32117,120,117}
771,{98,94,99,110,17217,93,107}
772},{108,94,82,88,88,104,126,111}
773#endif
774/*fin_reglage*/
775
776},{
777
778/*debut reglage 6 */
779#ifdef programme
780{197,191,175,185},{
781{0,0}
782,{0,0}
783,{0,0}
784,{0,0}
785,{0,0}
786,{0,0}
787,{0,0}
788,{0,0}
789,{0,0}
790,{0,0}
791,{0,0}
792,{0,0}
793,{0,0}
794,{0,0}
795,{0,0}
796,{0,0}
797,{0,0}
798,{0,0}
799,{0,0}
800,{0,0}
801,{0,0}
802,{0,0}
803,{0,0}
804,{0,0}
805},{
806{106,98,93,71}
807,{66,74,87,66}
808,{48,46,38,33}
809,{40,41,33,26}
810,{25,29,40,57}
811,{63,62,71,80}
812},{
813{83,79,75,75,92,112,31100}
814,{125,126,117,113,107,94,20315}
815,{108,116,122,124,117,120,32117}
816,{110,99,94,98,107,93,17217}
817},{88,82,94,108,111,126,104,88}
818#else
819{185,175,191,197},{
820{0,0}
821,{0,0}
822,{0,0}
823,{0,0}
824,{0,0}
825,{0,0}
826,{0,0}
827,{0,0}
828,{0,0}
829,{0,0}
830,{0,0}
831,{0,0}
832,{0,0}
833,{0,0}
834,{0,0}
835,{0,0}
836,{0,0}
837,{0,0}
838,{0,0}
839,{0,0}
840,{0,0}
841,{0,0}
842,{0,0}
843,{0,0}
844},{
845{71,93,98,106}
846,{66,87,74,66}
847,{33,38,46,48}
848,{26,33,41,40}
849,{57,40,29,25}
850,{80,71,62,63}
851},{
852{75,75,79,83,31100,112,92}
853,{113,117,126,125,20315,94,107}
854,{124,122,116,108,32117,120,117}
855,{98,94,99,110,17217,93,107}
856},{108,94,82,88,88,104,126,111}
857#endif
858/*fin_reglage*/
859
860},{
861
862/*debut reglage 7 */
863#ifdef programme
864{197,191,175,185},{
865{0,0}
866,{0,0}
867,{0,0}
868,{0,0}
869,{0,0}
870,{0,0}
871,{0,0}
872,{0,0}
873,{0,0}
874,{0,0}
875,{0,0}
876,{0,0}
877,{0,0}
878,{0,0}
879,{0,0}
880,{0,0}
881,{0,0}
882,{0,0}
883,{0,0}
884,{0,0}
885,{0,0}
886,{0,0}
887,{0,0}
888,{0,0}
889},{
890{106,98,93,71}
891,{66,74,87,66}
892,{48,46,38,33}
893,{40,41,33,26}
894,{25,29,40,57}
895,{63,62,71,80}
896},{
897{83,79,75,75,92,112,31100}
898,{125,126,117,113,107,94,20315}
899,{108,116,122,124,117,120,32117}
900,{110,99,94,98,107,93,17217}
901},{88,82,94,108,111,126,104,88}
902#else
903{185,175,191,197},{
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,{0,0}
924,{0,0}
925,{0,0}
926,{0,0}
927,{0,0}
928},{
929{71,93,98,106}
930,{66,87,74,66}
931,{33,38,46,48}
932,{26,33,41,40}
933,{57,40,29,25}
934,{80,71,62,63}
935},{
936{75,75,79,83,31100,112,92}
937,{113,117,126,125,20315,94,107}
938,{124,122,116,108,32117,120,117}
939,{98,94,99,110,17217,93,107}
940},{108,94,82,88,88,104,126,111}
941#endif
942/*fin_reglage*/
943
944} };
945
946/* ------------------------------------ corps des fonctions ------------------------------ */
947/* -------------------------------------------------------------------------------------------- */
948
949
950
951unsigned int4 val_long(char x)
952{
953unsigned int4 a,xl;
954char aa;
955aa=x-2;
956a=aa;
957if(x<3) xl=x; else xl=((a&1) + 2)<<(a>>1);
958return(xl);
959}
960
961
962double val_double(char x)
963{
964unsigned long a,xl;
965if(x<0) x=-x; a=x; if(!a) xl=0; else xl=((a&1) + 2)<<(a>>1);
966if(x>0) return(1e-4*(double)xl); else return(-1e-4*(double)xl);
967}
968
969int new_val_dac(int a,char code)
970{
971if(code&0x80) a=(code&0x7f) <<5 ;
972else {
973 if(code&0x40) a+=code&0x3f;
974 else a-=code&0x3f;
975 }
976return(a);
977}
978
979
980
981
982int calcul_somme_block(block_type_modele* blk,int longueur)
983{
984int i,so=0;;
985for(i=0;i<(longueur/4-4);i++) so^=(int)blk->mot[i];
986/* somme sur tous les mots internes : on exclus le dbut, les codes et la fin */
987return((so^(so>>16))&0xffff);
988}
989
990
991
992
993void valide_block(block_type_modele* blk,int type,int block_num)
994{
995int somme,longueur;
996def_long_block
997longueur=long_block[type];
998/*printf("valide block adresse %x type %d numblock %d longueur=%d \n" */
999/* ,(unsigned)blk,type,block_num,longueur);*/
1000blk->debut = debut_block_mesure;
1001blk->code2 = (((long)block_num) & 0xffffff ) | ( (((long)type)<<24)&0xff000000 );
1002
1003blk->mot[longueur/4-4] = fin_block_mesure;
1004somme=calcul_somme_block(blk,longueur);
1005blk->code1 = (((long)longueur)<<16) | somme;
1006}
1007
1008/* Quand on est sur une machine swappee, on ne cherche pas a verifier */
1009/* le checksum, puisqu'on a modifie les blocs, sans swapper par exemple */
1010/* les chars des noms de bolometres et des chaines GPS... */
1011#ifdef __alpha
1012#define SWAP
1013#endif
1014#if defined(Linux) || defined(linux)
1015#define SWAP
1016#endif
1017
1018
1019
1020int verifie_block(block_type_modele* blk)
1021{
1022int type,lg,som;
1023def_long_block
1024if(blk->debut != debut_block_mesure) return(block_debut_erreur);
1025type=type_block(blk); if( (type<0) ||(type>=nb_type_blocks) ) return(block_type_inconnu);
1026lg=longueur_block(blk); if( lg != long_block[type] ) return(block_longueur_erreur);
1027if( blk->mot[(lg/4)-4] != fin_block_mesure) return(block_fin_erreur);
1028#ifndef SWAP
1029som=calcul_somme_block(blk,lg); if( som!= somme_block(blk)) return(block_somme_erreur);
1030#endif
1031return(block_correct);
1032}
1033
1034
1035int verifie_block_printf(block_type_modele* blk)
1036{
1037int type,lg,som;
1038def_long_block
1039def_nom_block
1040if(blk->debut != debut_block_mesure)
1041 {
1042 printf(" erreur dans le code debut de block \n");
1043 return(block_debut_erreur);
1044 }
1045
1046type=type_block(blk);
1047if( (type<0) || (type>nb_type_blocks) )
1048 {
1049 printf(" block de type %d inconnu\n",type);
1050 return(block_type_inconnu);
1051 }
1052
1053lg=longueur_block(blk);
1054if( lg!=long_block[type] )
1055 {
1056 printf(" block type %s erreur de longueur (nominal=%d , dans le block=%d \n"
1057 ,nom_block[type],long_block[type],lg);
1058 return(block_longueur_erreur);
1059 }
1060
1061som=calcul_somme_block(blk,lg);
1062if( som!=somme_block(blk) )
1063 {
1064 printf(" block type %s : erreur de somme (calculee=%d , dans le block=%d \n"
1065 ,nom_block[type],som,somme_block(blk) );
1066 return(block_somme_erreur);
1067 }
1068
1069if(blk->mot[(lg/4)-4] != fin_block_mesure)
1070 {
1071 printf(" block type %s erreur de code fin de block : trouve %x au lieu de %x \n"
1072 ,nom_block[type],(int)blk->mot[(lg/4)-4],fin_block_mesure);
1073 return(block_fin_erreur);
1074 }
1075
1076return(block_correct);
1077}
1078
1079
1080
1081
1082
1083
1084
Note: See TracBrowser for help on using the repository browser.