source: Sophya/trunk/Poubelle/archTOI.old/archeops_28.c@ 395

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

archtoi 2 aout 99

File size: 24.1 KB
Line 
1//for archediab
2//#include "manip.h"
3//for archTOI
4#include <stdio.h>
5#include "archeops.h"
6
7/* sauve vol trapani 2eme config de vol */
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/* Pour les thermometres 1 à 4 (germanium et carbone Allan-Bradley) */
25/* les coefficients sont utilisés differemment, ils permettent de convertir */
26/* R vers T ( c(6) est un offset sur la mesure de R par rapport aux mesures 4 fils)*/
27/* llR= log(log(R - c(6))-c(0)) */
28/* T = exp(c(1) + c(2)* llR + c(3)* llR* llR + c(4)* llR* llR* llR + */
29/* c(5)* llR* llR* llR* llR) */
30/* */
31/* version vol Trapani */
32/* on corrige le biais de temperature coef2=1.1 old, coef3=old/1.1^coef4 */
33/* */
34/* */
35/* */
36/* */
37/* */
38/****************************************************************************************/
39
40
41/**************************************************************************************/
42/* */
43/* pour les MLPA : gain = 100 diviseur = 101 ou 330 */
44/* pour les bebodiff : gain = diviseur = 100Kohm / R preampli */
45/* pour les bebodiff : la capa est corrigee d'un facteur 0.868 */
46/* pour les cartes modifiees : mettre diviseur=0 */
47/* et capa = la resistance de chage en Megohm */
48/* */
49/**************************************************************************************/
50
51
52/* numero_nom, on/off , 0 = MLPA , N° bolo , gain_pa , capa*1000 , diviseur , coef*10000 */
53/* , 0 ou 1 , 2..8 = BEBO , hard , , 4700 , 333 , */
54/* 10 = Bediff , , , */
55
56/* pour les bediff (code 10) le n° de bolo est N° de bebo*8 + numero dans la bebo */
57/* soit : 1 2 3 4 5 6 .. 9 10 11 12 13 14 .. 17 18 19 20 21 22 .. etc */
58
59
60/*debut_param*/
61/*---------------------------------- fenetre : -----------------------------------*/
62
63/* ------------------------ configuration de vol 5 juillet 99-----------------------------*/
64param_bolo parametr={28,24,36,88,18,
65
66{
67{ 11 , 2,10, 1 , 200, 22000 , 200 }, /* 1 */
68{ 9 , 1,10, 2 , 200, 22000 , 200 },
69{ 8 , 1,10, 3 , 200, 22000 , 200 },
70{ 14 , 2,10, 4 , 200, 22000 , 200 },
71
72{ 5 , 1,10, 5 ,1000, 4700 , 1000 }, /* 5 */
73{ 0 , 2,10, 6 ,1000, 4700 , 1000 },
74{ 10 , 1,10, 9 ,1000, 4700 , 1000 },
75{ 0 , 2,10,10, 1000, 4700 , 1000 },
76
77{ 2 , 1,10,11, 1000, 4700 , 1000 }, /* 9 */
78{ 4 , 1,10,12, 1000, 4700 , 1000 },
79{ 7 , 2,10,13, 1000, 4700 , 1000 },
80{ 1 , 1,10,14, 1000, 4700 , 1000 },
81
82{ 13 , 1,10,17, 1000, 4700 , 1000 }, /* 13 */
83{ 3 , 1,10,18, 1000, 4700 , 1000 },
84{ 12 , 1,10,19, 1000, 4700 , 1000 },
85{ 6 , 1,10,20, 1000, 4700 , 1000 },
86
87{ 15 , 1,10,21, 200, 22000 , 200 }, /* 17 */
88{ 16 , 1,10,22, 200, 22000 , 200 },
89{ 17 , 1,10,25, 500, 22000 , 500 },
90{ 18 , 2,10,26, 500, 22000 , 500 },
91
92{ 20 , 3,10,27, 1000, 22000 , 0 }, /* 21 */
93{ 21 , 3,10,28, 1000, 1000 , 0 },
94{ 22 , 3,10,29, 1000, 1000 , 0 },
95{ 23 , 3,10,30, 1000, 1000 , 0 },
96
97},
98{
99{ "Niente " , { 5000 , 0 , 0, 0,0,0,0} }, /* 0 */
100{ "ch1-bolo1" , { 5000 , 600000 , 154000, 63039, 25000, 0, 0} }, /* 1 */
101{ "ch1-bolo2" , { 5000 , 600000 , 154000, 47279, 25000, 0, 0} },
102{ "ch1-bolo3" , { 5000 , 600000 , 154000, 51219, 25000, 0, 0} },
103{ "ch2-bolo4" , { 5000 , 600000 , 154000, 70919, 25000, 0, 0} },
104{ "ch2-bolo5" , { 5000 , 600000 , 154000, 78799, 25000, 0, 0} },
105{ "ch3-bolo6" , { 5000 , 600000 , 154000, 86678, 25000, 0, 0} },
106
107{ "Dum100mK1" , { 5000 , 588000 , 125000, 0,0,0,0} }, /* 7 */
108{ "Dum100mK2" , { 5000 , 588000 , 125000, 0,0,0,0} },
109/*{ "Dum100mK3" , { 5000 , 1361800 , 125000, 0,0,0,0} }, */
110{ "Dum100mK4" , { 5000 , 1361800 , 125000, 0,0,0,0} }, /* 9 */
111/*{ "Dum100mK5" , { 5000 , 1361800 , 125000, 0,0,0,0} }, */
112{ "Dum100mK6" , { 5000 , 1361800 , 125000, 0,0,0,0} },
113
114{ "Lou100mK1" , { 5000 , 5680000 , 560000, 0,0,0,0} }, /* 11 */
115{ "Lou100mK2" , { 5000 , 5680000 , 560000, 0,0,0,0} },
116{ "Lou100mK3" , { 5000 , 5680000 , 560000, 0,0,0,0} },
117{ "Lou100mK4" , { 5000 , 5680000 , 560000, 0,0,0,0} },
118
119{ "Lou1.6K5 " , { 5000 , 0 , 0, 0,0,0,0} }, /* 15 */
120{ "Lou1.6K6 " , { 5000 , 0 , 0, 0,0,0,0} },
121{ "Lou10K7 " , { 5000 , 0 , 0, 0,0,0,0} },
122{ "Lou10K8 " , { 5000 , 0 , 0, 0,0,0,0} },
123
124{ "R10MOhm " , { 5000 , 0 , 0, 0,0,0,0} }, /* 19 */
125
126/* La germanium doit toujours etre en premier par rapport aux autres thermos absolus */
127{ "germanium" , { 0 , 30719 , -910 , -16389 , 2927 , 0, 0} }, /* 20 */
128{ "therm_4k" , { 45000 , 28907 , -16028 , -1327 , 1472 , 872, 52500} },
129{ "therm_1.6k" , { 45000 , 28907 , -16028 , -1327 , 1472 , 872, 566700} },
130{ "therm_10k" , { 45000 , 28907 , -16028 , -1327 , 1472 , 872, 138100} },
131
132}
133
134};
135/*fin_param*/
136
137/* Definition Mai-Juin 1999
138{
139{ "v1-bedif1" , 1,10,1 , 200, 22000 , 200, { 5000 , 123100 , 334200,0,0,0,0} },
140{ "v1-bedif2" , 1,10,2 , 200, 22000 , 200, { 500 , 136180 , 9010,0,0,0,0} },
141{ "v1-bedif3" , 1,10,3 , 200, 22000 , 200, { 500 , 136180 , 9010,0,0,0,0} },
142{ "v1-bedif4" , 1,10,4 , 200, 22000 , 200, { 5000 , 123100 , 334200,0,0,0,0} },
143{ "v1-bedif5" , 1,10,5 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
144{ "v1-bedif6" , 1,10,6 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
145
146{ "v1-bedif7" , 1,10,9 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
147{ "v1-bedif8" , 1,10,10, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
148{ "v1-bedif9" , 1,10,11, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
149{ "v1-bedif10" , 1,10,12, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
150{ "v1-bedif11" , 1,10,13, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
151{ "v1-bedif12" , 1,10,14, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
152
153{ "v1-bedif13" , 1,10,17, 1000, 100000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
154{ "v1-bedif14" , 1,10,18, 1000, 470000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
155{ "bedif15" , 1,10,19, 1000, 470000 , 1000, { 500 , 58800 , 12500,0,0,0,0} },
156{ "bedif16" , 1,10,20, 1000,2200000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
157{ "bedif17" , 1,10,21, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
158{ "bedif18" , 1,10,22, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
159
160{ "v1-bedif19" , 2,10,25, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
161{ "v1-bedif20" , 2,10,26, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
162{ "germanium" , 3,10,27, 1000, 22000 , 0, { 3500 , 17100 , 646500,0,0,0,0} },
163{ "therm_4k" , 3,10,28, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
164{ "therm_1.6k" , 3,10,29, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
165{ "therm_10k" , 3,10,30, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
166
167}*/
168
169/* bolos campagne 1998-1999 */
170/*
171reg_NbSi.J, 1, 0, 1, 100, 4.7, 333, .5 ,519.6 , 8.286
172v1-231...L, 1, 0, 2, 100, 4.7, 333, .5 , 1.7 , 32.41 , 0.333 , 10 , 20.30 , 11.41
173v1-232...N, 1, 0, 3, 100, 4.7, 333,
174v1-237...E, 1, 0, 4, 100, 4.7, 333,
175
176reg_JamieO, 1, 0, 5, 100, 4.7, 101,
177
178V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
179V2-230...B, 1, 0, 7, 100, 4.7, 333, .5 , 8.26 , 26.61 , 5.10 , 7 , 9.354 , 1.026
180V2-205...Q, 1, 0, 8, 100, 4.7, 333, .518 , 81 , 25.2
181V2-208...P, 1, 0, 9, 100, 4.7, 333, .5 , 12.31 , 33.42 , 0.627 , 6.5 , 8.113 , 2.958
182
183*/
184/*bolos campagne 1997-1998 */
185/*
186
187v1-208...J, 1, 0, 1, 100, 4.7, 333, .5 , 12.31 , 33.42
188v1-232...L, 1, 0, 2, 100, 4.7, 333,
189v1-205...N, 1, 0, 3, 100, 4.7, 333, .518 , 81 , 25.2
190v1-NbSi..E, 1, 0, 4, 100, 4.7, 333, .5 ,519.6 , 8.286
191Jamie....O, 1, 0, 5, 100, 4.7, 101,
192V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
193V2-224...B, 1, 0, 7, 100, 4.7, 333, .5 ,3.43 , 26.6
194V2-230...Q, 1, 0, 8, 100, 4.7, 333, .5 , 8.26 , 26.61
195V2-231...P, 1, 0, 9, 100, 4.7, 333, .5 , 1.7 , 32.41
196
197*/
198
199
200int mode_transmission_telemesure[nb_modes_telemesure][nb_type_blocks]= {
201
202/* enregisteur de bord flash : plafond standard nominal */
203/* 0*/ { 0,10,15,50, 10,50, 0, 0, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0},
204
205/* 1*/ { 0,10,10, 1, 10, 3, 0, 0, 0, 1, 0, 0, 1, 0, 4,2500, 0, 0, 0, 0},
206
207/* 2*/ { 0,10,05,01, 10,06, 0, 0, 0, 1, 0, 0, 1, 0, 2,2500, 0, 0, 0, 0},
208
209/* 3*/ { 0,10, 1,25, 10, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0},
210
211/* 4*/ { 0,10,15,50, 10,25, 0, 0, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
212
213/* 5*/ { 0,10,15,50, 10,25, 0, 0, 0, 0, 1, 0, 0, 0, 0,2500, 0, 0, 0, 0},
214
215/* 6*/ { 0,10,15,50, 10,50, 0, 0, 0, 1, 0, 0, 1, 0, 2,2500, 0, 0, 0, 0},
216
217/* 7*/ { 0,10,15,50,100,50, 1, 1, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0},
218
219/* 8*/ { 0,10,15,50,100,50, 1, 1, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
220
221/* 9*/ { 0,10, 1, 1,100, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0}
222
223 };
224
225
226
227int mode_transmission_flash[nb_modes_flash][nb_type_blocks]= {
228
229
230/* enregisteur de bord flash : nominal */
231/* 0*/ { 0,50,15,25, 10,25, 0, 0, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0} ,
232
233/* enregisteur de bord flash : minimum */
234/* 1*/ { 0,50,50,50,50,100, 0, 0, 0, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0} ,
235
236/* enregisteur de bord flash : rien */
237/* 2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} };
238
239
240
241
242/*debut_nom_reglage*/
243/* 0->1 - demarrage par defaut - Nominal*/
244/* 1->2 - idem*/
245/* 2->3 - faible courant*/
246/* 3->4 - fort courant*/
247/* 4->5 - non fffdéfini*/
248/* 5->6 - non défini*/
249/* 6->7 - non défini*/
250/* 7->8 - non défini*/
251/*fin_nom_reglage*/
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284reglage_bolo reglage_standard[8]={{
285
286
287/*debut reglage 0 */
288#ifdef programme
289{32,76,8,1},{
290{20,0}
291,{1311522837,256000}
292,{1048576021,256004}
293,{20,0}
294,{1048576021,256001}
295,{20,0}
296,{262144021,128003}
297,{20,0}
298,{262144021,128001}
299,{262144021,128001}
300,{20,0}
301,{1048576021,256257}
302,{1048576021,256003}
303,{262144021,128001}
304,{262144789,128001}
305,{262144021,128001}
306,{100663317,256002}
307,{100716053,155650}
308,{1048576277,256003}
309,{20,0}
310,{1024021,0}
311,{262165,0}
312,{65557,0}
313,{1024020,0}
314},{
315{1,21,16,4}
316,{1,21,13,4}
317,{1,21,20,4}
318,{1,21,20,4}
319,{0,21,0,4}
320,{0,21,0,4}
321},{
322{3,1,21,24,21,24,0}
323,{0,1,9,1,0,0,0}
324,{0,1,9,1,0,0,0}
325,{6,1,9,34,30,0,65326}
326},{5,3,129,108,0,126,104,88}
327#else
328{1,8,76,32},{
329{20,0}
330,{1311522837,256000}
331,{1048576021,256004}
332,{20,0}
333,{1048576021,256001}
334,{20,0}
335,{262144021,128003}
336,{20,0}
337,{262144021,128001}
338,{262144021,128001}
339,{20,0}
340,{1048576021,256257}
341,{1048576021,256003}
342,{262144021,128001}
343,{262144789,128001}
344,{262144021,128001}
345,{100663317,256002}
346,{100716053,155650}
347,{1048576277,256003}
348,{20,0}
349,{1024021,0}
350,{262165,0}
351,{65557,0}
352,{1024020,0}
353},{
354{4,16,21,1}
355,{4,13,21,1}
356,{4,20,21,1}
357,{4,20,21,1}
358,{4,0,21,0}
359,{4,0,21,0}
360},{
361{24,21,1,3,0,24,21}
362,{1,9,1,0,0,0,0}
363,{1,9,1,0,0,0,0}
364,{34,9,1,6,65326,0,30}
365},{108,129,3,5,88,104,126,0}
366#endif
367/*fin_reglage*/
368
369
370},{
371
372/*debut reglage 1 */
373#ifdef programme
374{32,76,8,1},{
375{20,0}
376,{1311522837,256000}
377,{1048576021,256004}
378,{20,0}
379,{1048576021,256001}
380,{20,0}
381,{262144021,128003}
382,{20,0}
383,{262144021,128001}
384,{262144021,128001}
385,{20,0}
386,{1048576021,256257}
387,{1048576021,256003}
388,{262144021,128001}
389,{262144789,128001}
390,{262144021,128001}
391,{100663317,256002}
392,{100716053,155650}
393,{1048576277,256003}
394,{20,0}
395,{1024021,0}
396,{262165,0}
397,{65557,0}
398,{1024020,0}
399},{
400{1,21,16,4}
401,{1,21,13,4}
402,{1,21,20,4}
403,{1,21,20,4}
404,{0,21,0,4}
405,{0,21,0,4}
406},{
407{3,1,21,24,21,24,0}
408,{0,1,9,1,0,0,0}
409,{0,1,9,1,0,0,0}
410,{6,1,9,34,30,0,65326}
411},{5,3,129,108,0,126,104,88}
412#else
413{1,8,76,32},{
414{20,0}
415,{1311522837,256000}
416,{1048576021,256004}
417,{20,0}
418,{1048576021,256001}
419,{20,0}
420,{262144021,128003}
421,{20,0}
422,{262144021,128001}
423,{262144021,128001}
424,{20,0}
425,{1048576021,256257}
426,{1048576021,256003}
427,{262144021,128001}
428,{262144789,128001}
429,{262144021,128001}
430,{100663317,256002}
431,{100716053,155650}
432,{1048576277,256003}
433,{20,0}
434,{1024021,0}
435,{262165,0}
436,{65557,0}
437,{1024020,0}
438},{
439{4,16,21,1}
440,{4,13,21,1}
441,{4,20,21,1}
442,{4,20,21,1}
443,{4,0,21,0}
444,{4,0,21,0}
445},{
446{24,21,1,3,0,24,21}
447,{1,9,1,0,0,0,0}
448,{1,9,1,0,0,0,0}
449,{34,9,1,6,65326,0,30}
450},{108,129,3,5,88,104,126,0}
451#endif
452/*fin_reglage*/
453
454},{
455
456/*debut reglage 2 */
457#ifdef programme
458{32,76,8,1},{
459{20,0}
460,{100721941,256000}
461,{1048607509,256004}
462,{20,0}
463,{1048586773,256003}
464,{20,0}
465,{50335509,128001}
466,{20,0}
467,{50331669,128001}
468,{50336789,128001}
469,{20,0}
470,{1048622101,256259}
471,{1048635413,256003}
472,{50331669,128001}
473,{50352661,128001}
474,{50337813,128001}
475,{100665109,256002}
476,{100664597,155650}
477,{1048600341,256003}
478,{20,0}
479,{1024021,0}
480,{65557,0}
481,{65557,0}
482,{262165,0}
483},{
484{1,21,11,4}
485,{1,21,13,4}
486,{1,21,20,4}
487,{1,21,20,4}
488,{0,20,0,1}
489,{0,20,0,1}
490},{
491{3,1,21,24,21,24,0}
492,{0,1,9,1,0,0,0}
493,{0,1,9,1,0,0,0}
494,{6,17,0,34,30,0,65386}
495},{5,3,129,108,0,126,104,88}
496#else
497{1,8,76,32},{
498{20,0}
499,{100721941,256000}
500,{1048607509,256004}
501,{20,0}
502,{1048586773,256003}
503,{20,0}
504,{50335509,128001}
505,{20,0}
506,{50331669,128001}
507,{50336789,128001}
508,{20,0}
509,{1048622101,256259}
510,{1048635413,256003}
511,{50331669,128001}
512,{50352661,128001}
513,{50337813,128001}
514,{100665109,256002}
515,{100664597,155650}
516,{1048600341,256003}
517,{20,0}
518,{1024021,0}
519,{65557,0}
520,{65557,0}
521,{262165,0}
522},{
523{4,11,21,1}
524,{4,13,21,1}
525,{4,20,21,1}
526,{4,20,21,1}
527,{1,0,20,0}
528,{1,0,20,0}
529},{
530{24,21,1,3,0,24,21}
531,{1,9,1,0,0,0,0}
532,{1,9,1,0,0,0,0}
533,{34,0,17,6,65386,0,30}
534},{108,129,3,5,88,104,126,0}
535#endif
536/*fin_reglage*/
537
538},{
539
540/*debut reglage 3 */
541#ifdef programme
542{32,76,8,1},{
543{20,0}
544,{100721941,256000}
545,{1048607509,256004}
546,{20,0}
547,{1048586773,256003}
548,{20,0}
549,{524291861,128001}
550,{20,0}
551,{524288021,128001}
552,{524293141,128001}
553,{20,0}
554,{1048622101,256259}
555,{1048635413,256003}
556,{524288021,128001}
557,{524309013,128001}
558,{524294165,128001}
559,{100665109,256002}
560,{100664597,155650}
561,{1048600341,256003}
562,{20,0}
563,{1024021,0}
564,{65557,0}
565,{65557,0}
566,{65557,0}
567},{
568{1,21,18,4}
569,{1,21,13,4}
570,{1,21,20,4}
571,{1,21,20,4}
572,{0,20,0,1}
573,{0,20,0,1}
574},{
575{3,1,21,24,21,24,0}
576,{0,1,9,1,0,0,0}
577,{0,1,9,1,0,0,0}
578,{6,17,0,34,30,0,65386}
579},{5,3,129,108,0,126,104,88}
580#else
581{1,8,76,32},{
582{20,0}
583,{100721941,256000}
584,{1048607509,256004}
585,{20,0}
586,{1048586773,256003}
587,{20,0}
588,{524291861,128001}
589,{20,0}
590,{524288021,128001}
591,{524293141,128001}
592,{20,0}
593,{1048622101,256259}
594,{1048635413,256003}
595,{524288021,128001}
596,{524309013,128001}
597,{524294165,128001}
598,{100665109,256002}
599,{100664597,155650}
600,{1048600341,256003}
601,{20,0}
602,{1024021,0}
603,{65557,0}
604,{65557,0}
605,{65557,0}
606},{
607{4,18,21,1}
608,{4,13,21,1}
609,{4,20,21,1}
610,{4,20,21,1}
611,{1,0,20,0}
612,{1,0,20,0}
613},{
614{24,21,1,3,0,24,21}
615,{1,9,1,0,0,0,0}
616,{1,9,1,0,0,0,0}
617,{34,0,17,6,65386,0,30}
618},{108,129,3,5,88,104,126,0}
619#endif
620/*fin_reglage*/
621
622},{
623
624/*debut reglage 4 */
625#ifdef programme
626{39,62,9,1},{
627{20,0}
628,{-100659180,229382}
629,{-100659436,294918}
630,{20,0}
631,{-100663276,221189}
632,{-100663276,5}
633,{-100659436,245762}
634,{-100663276,5}
635,{-100658154,245761}
636,{-100658156,253954}
637,{20,0}
638,{-100663276,204805}
639,{-100663276,16389}
640,{-100656874,1}
641,{-100656874,16385}
642,{-100663276,3}
643,{-100506347,6}
644,{-100509675,6}
645,{-100372972,6}
646,{2097174,0}
647,{1024022,0}
648,{16406,0}
649,{4117,0}
650,{262164,0}
651},{
652{2,22,24,1}
653,{1,20,24,4}
654,{0,20,24,4}
655,{0,20,24,3}
656,{0,20,24,4}
657,{0,20,24,4}
658},{
659{0,1,9,1,0,0,0}
660,{0,1,9,1,0,0,0}
661,{0,1,9,1,0,0,0}
662,{0,1,9,1,0,0,0}
663},{2,3,129,108,2,126,104,88}
664#else
665{1,9,62,39},{
666{20,0}
667,{-100659180,229382}
668,{-100659436,294918}
669,{20,0}
670,{-100663276,221189}
671,{-100663276,5}
672,{-100659436,245762}
673,{-100663276,5}
674,{-100658154,245761}
675,{-100658156,253954}
676,{20,0}
677,{-100663276,204805}
678,{-100663276,16389}
679,{-100656874,1}
680,{-100656874,16385}
681,{-100663276,3}
682,{-100506347,6}
683,{-100509675,6}
684,{-100372972,6}
685,{2097174,0}
686,{1024022,0}
687,{16406,0}
688,{4117,0}
689,{262164,0}
690},{
691{1,24,22,2}
692,{4,24,20,1}
693,{4,24,20,0}
694,{3,24,20,0}
695,{4,24,20,0}
696,{4,24,20,0}
697},{
698{1,9,1,0,0,0,0}
699,{1,9,1,0,0,0,0}
700,{1,9,1,0,0,0,0}
701,{1,9,1,0,0,0,0}
702},{108,129,3,2,88,104,126,2}
703#endif
704/*fin_reglage*/
705
706},{
707
708/*debut reglage 5 */
709#ifdef programme
710{39,68,9,1},{
711{20,0}
712,{1048982293,229382}
713,{1049128469,253958}
714,{20,0}
715,{1048966677,245765}
716,{20,0}
717,{262157846,245762}
718,{1048919829,5}
719,{262156054,245761}
720,{262154006,253954}
721,{20,0}
722,{1049123349,229381}
723,{1049157141,237573}
724,{262154262,1}
725,{262158614,16385}
726,{262149654,3}
727,{262750740,237572}
728,{262606612,122884}
729,{-1174095083,139270}
730,{20,0}
731,{16406,0}
732,{16406,0}
733,{4117,0}
734,{262164,0}
735},{
736{1,22,16,1}
737,{1,22,16,4}
738,{1,22,16,4}
739,{1,20,16,3}
740,{1,21,20,4}
741,{1,21,20,4}
742},{
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,{0,1,9,1,0,0,0}
747},{2,3,129,108,3,126,104,88}
748#else
749{1,9,68,39},{
750{20,0}
751,{1048982293,229382}
752,{1049128469,253958}
753,{20,0}
754,{1048966677,245765}
755,{20,0}
756,{262157846,245762}
757,{1048919829,5}
758,{262156054,245761}
759,{262154006,253954}
760,{20,0}
761,{1049123349,229381}
762,{1049157141,237573}
763,{262154262,1}
764,{262158614,16385}
765,{262149654,3}
766,{262750740,237572}
767,{262606612,122884}
768,{-1174095083,139270}
769,{20,0}
770,{16406,0}
771,{16406,0}
772,{4117,0}
773,{262164,0}
774},{
775{1,16,22,1}
776,{4,16,22,1}
777,{4,16,22,1}
778,{3,16,20,1}
779,{4,20,21,1}
780,{4,20,21,1}
781},{
782{1,9,1,0,0,0,0}
783,{1,9,1,0,0,0,0}
784,{1,9,1,0,0,0,0}
785,{1,9,1,0,0,0,0}
786},{108,129,3,2,88,104,126,3}
787#endif
788/*fin_reglage*/
789
790},{
791
792/*debut reglage 6 */
793#ifdef programme
794{197,191,175,185},{
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,{0,0}
806,{0,0}
807,{0,0}
808,{0,0}
809,{0,0}
810,{0,0}
811,{0,0}
812,{0,0}
813,{0,0}
814,{0,0}
815,{0,0}
816,{0,0}
817,{0,0}
818,{0,0}
819},{
820{106,98,93,71}
821,{66,74,87,66}
822,{48,46,38,33}
823,{40,41,33,26}
824,{25,29,40,57}
825,{63,62,71,80}
826},{
827{83,79,75,75,92,112,31100}
828,{125,126,117,113,107,94,20315}
829,{108,116,122,124,117,120,32117}
830,{110,99,94,98,107,93,17217}
831},{88,82,94,108,111,126,104,88}
832#else
833{185,175,191,197},{
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,{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},{
859{71,93,98,106}
860,{66,87,74,66}
861,{33,38,46,48}
862,{26,33,41,40}
863,{57,40,29,25}
864,{80,71,62,63}
865},{
866{75,75,79,83,31100,112,92}
867,{113,117,126,125,20315,94,107}
868,{124,122,116,108,32117,120,117}
869,{98,94,99,110,17217,93,107}
870},{108,94,82,88,88,104,126,111}
871#endif
872/*fin_reglage*/
873
874},{
875
876/*debut reglage 7 */
877#ifdef programme
878{197,191,175,185},{
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,{0,0}
890,{0,0}
891,{0,0}
892,{0,0}
893,{0,0}
894,{0,0}
895,{0,0}
896,{0,0}
897,{0,0}
898,{0,0}
899,{0,0}
900,{0,0}
901,{0,0}
902,{0,0}
903},{
904{106,98,93,71}
905,{66,74,87,66}
906,{48,46,38,33}
907,{40,41,33,26}
908,{25,29,40,57}
909,{63,62,71,80}
910},{
911{83,79,75,75,92,112,31100}
912,{125,126,117,113,107,94,20315}
913,{108,116,122,124,117,120,32117}
914,{110,99,94,98,107,93,17217}
915},{88,82,94,108,111,126,104,88}
916#else
917{185,175,191,197},{
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,{0,0}
929,{0,0}
930,{0,0}
931,{0,0}
932,{0,0}
933,{0,0}
934,{0,0}
935,{0,0}
936,{0,0}
937,{0,0}
938,{0,0}
939,{0,0}
940,{0,0}
941,{0,0}
942},{
943{71,93,98,106}
944,{66,87,74,66}
945,{33,38,46,48}
946,{26,33,41,40}
947,{57,40,29,25}
948,{80,71,62,63}
949},{
950{75,75,79,83,31100,112,92}
951,{113,117,126,125,20315,94,107}
952,{124,122,116,108,32117,120,117}
953,{98,94,99,110,17217,93,107}
954},{108,94,82,88,88,104,126,111}
955#endif
956/*fin_reglage*/
957
958} };
959
960/* ------------------------------------ corps des fonctions ------------------------------ */
961/* -------------------------------------------------------------------------------------------- */
962
963
964
965unsigned int4 val_long(char x)
966{
967unsigned long a,xl;
968char aa;
969aa=x-2;
970a=aa;
971if(x<3) xl=x; else xl=((a&1) + 2)<<(a>>1);
972return(xl);
973}
974
975
976double val_double(char x)
977{
978unsigned long a,xl;
979if(x<0) x=-x; a=x; if(!a) xl=0; else xl=((a&1) + 2)<<(a>>1);
980if(x>0) return(1e-4*(double)xl); else return(-1e-4*(double)xl);
981}
982
983int new_val_dac(int a,char code)
984{
985if(code&0x80) a=(code&0x7f) <<5 ;
986else {
987 if(code&0x40) a+=code&0x3f;
988 else a-=code&0x3f;
989 }
990return(a);
991}
992
993
994
995
996int calcul_somme_block(block_type_modele* blk,int longueur)
997{
998int i,so=0;;
999for(i=0;i<(longueur/4-4);i++) so^=(int)blk->mot[i];
1000/* somme sur tous les mots internes : on exclus le dbut, les codes et la fin */
1001return((so^(so>>16))&0xffff);
1002}
1003
1004
1005
1006
1007void valide_block(block_type_modele* blk,int type,int block_num)
1008{
1009int somme,longueur;
1010def_long_block
1011longueur=long_block[type];
1012/*printf("valide block adresse %x type %d numblock %d longueur=%d \n" */
1013/* ,(unsigned)blk,type,block_num,longueur);*/
1014blk->debut = debut_block_mesure;
1015somme=0;blk->code1 = (((long)longueur)<<16) | somme;
1016blk->code2 = (((long)block_num) & 0xffffff ) | ( (((long)type)<<24)&0xff000000 );
1017
1018blk->mot[longueur/4-4] = fin_block_mesure;
1019
1020#if defined(_ECC_LIB_H_)
1021{
1022int place_ecc;
1023place_ecc=(longueur-4-ECC_SIZE-SIZE_HEAD-((longueur-4-SIZE_HEAD)/ECC_TOTAL)*ECC_SIZE)/4;
1024SetEcc( blk, (unsigned char *) &(blk->mot[place_ecc] ) ) ;
1025}
1026#endif
1027
1028somme=calcul_somme_block(blk,longueur);
1029blk->code1 = (((long)longueur)<<16) | somme;
1030/* l'ecc est faux car on a change la somme: mettre la somme a zero avant de tester ecc */
1031}
1032
1033/* Quand on est sur une machine swappee, on ne cherche pas a verifier */
1034/* le checksum, puisqu'on a modifie les blocs, sans swapper par exemple */
1035/* les chars des noms de bolometres et des chaines GPS... */
1036#ifdef __alpha
1037#define SWAP
1038#endif
1039#if defined(Linux) || defined(linux)
1040#define SWAP
1041#endif
1042
1043
1044
1045int verifie_block(block_type_modele* blk)
1046{
1047int type,lg,som;
1048def_long_block
1049if(blk->debut != debut_block_mesure) return(block_debut_erreur);
1050type=type_block(blk); if( (type<0) ||(type>=nb_type_blocks) ) return(block_type_inconnu);
1051lg=longueur_block(blk); if( lg != long_block[type] ) return(block_longueur_erreur);
1052if( blk->mot[(lg/4)-4] != fin_block_mesure) return(block_fin_erreur);
1053#ifndef SWAP
1054som=calcul_somme_block(blk,lg); if( som!= somme_block(blk)) return(block_somme_erreur);
1055#endif
1056return(block_correct);
1057}
1058
1059
1060int verifie_block_printf(block_type_modele* blk)
1061{
1062int type,lg,som;
1063def_long_block
1064def_nom_block
1065if(blk->debut != debut_block_mesure)
1066 {
1067 printf(" erreur dans le code debut de block \n");
1068 return(block_debut_erreur);
1069 }
1070
1071type=type_block(blk);
1072if( (type<0) || (type>nb_type_blocks) )
1073 {
1074 printf(" block de type %d inconnu\n",type);
1075 return(block_type_inconnu);
1076 }
1077
1078lg=longueur_block(blk);
1079if( lg!=long_block[type] )
1080 {
1081 printf(" block type %s erreur de longueur (nominal=%d , dans le block=%d \n"
1082 ,nom_block[type],long_block[type],lg);
1083 return(block_longueur_erreur);
1084 }
1085
1086som=calcul_somme_block(blk,lg);
1087if( som!=somme_block(blk) )
1088 {
1089 printf(" block type %s : erreur de somme (calculee=%d , dans le block=%d \n"
1090 ,nom_block[type],som,somme_block(blk) );
1091 return(block_somme_erreur);
1092 }
1093
1094if(blk->mot[(lg/4)-4] != fin_block_mesure)
1095 {
1096 printf(" block type %s erreur de code fin de block : trouve %x au lieu de %x \n"
1097 ,nom_block[type],(int)blk->mot[(lg/4)-4],fin_block_mesure);
1098 return(block_fin_erreur);
1099 }
1100
1101return(block_correct);
1102}
1103
1104
1105
1106
1107
Note: See TracBrowser for help on using the repository browser.