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

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

vendredi soir...

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