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

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

archtoi 2 aout 99

File size: 21.0 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/* Pour les thermometres 1 à 4 (germanium et carbone Allan-Bradley) */
25/* les coefficients sont utilisés differemment, ills permettent de convertir */
26/* R vers T */
27/* llR= log(log(R)-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/**************************************************************************************/
32
33
34/**************************************************************************************/
35/* */
36/* pour les MLPA : gain = 100 diviseur = 101 ou 330 */
37/* pour les bebodiff : gain = diviseur = 100Kohm / R preampli */
38/* pour les bebodiff : la capa est corrigee d'un facteur 0.868 */
39/* pour les cartes modifiees : mettre diviseur=0 */
40/* et capa = la resistance de chage en Megohm */
41/* */
42/**************************************************************************************/
43
44
45/* numero_nom, on/off , 0 = MLPA , N° bolo , gain_pa , capa*1000 , diviseur , coef*10000 */
46/* , 0 ou 1 , 2..8 = BEBO , hard , , 4700 , 333 , */
47/* 10 = Bediff , , , */
48
49/* pour les bediff (code 10) le n° de bolo est N° de bebo*8 + numero dans la bebo */
50/* soit : 1 2 3 4 5 6 .. 9 10 11 12 13 14 .. 17 18 19 20 21 22 .. etc */
51
52
53/*debut_param*/
54/*---------------------------------- fenetre : -----------------------------------*/
55
56param_bolo parametr={27,24,36,88,18,
57
58{
59{ 0 , 2,10,1 , 200, 22000 , 200 },
60{ 10 , 1,10,2 , 200, 22000 , 200 },
61{ 8 , 1,10,3 , 200, 22000 , 200 },
62{ 0 , 2,10,4 , 200, 22000 , 200 },
63
64{ 2 , 1,10,5 , 1000, 4700 , 1000 },
65{ 0 , 2,10,6 , 1000, 4700 , 1000 },
66{ 4 , 1,10,9 , 1000, 4700 , 1000 },
67{ 0 , 2,10,10, 1000, 4700 , 1000 },
68
69{ 10 , 1,10,11, 1000, 4700 , 1000 },
70{ 7 , 1,10,12, 1000, 4700 , 1000 },
71{ 0 , 1,10,13, 1000, 4700 , 1000 },
72{ 17 , 1,10,14, 1000, 4700 , 1000 },
73
74{ 3 , 1,10,17, 1000, 4700 , 1000 },
75{ 1 , 1,10,18, 1000, 4700 , 1000 },
76{ 5 , 1,10,19, 1000, 4700 , 1000 },
77{ 0 , 1,10,20, 1000, 4700 , 1000 },
78
79{ 13 , 1,10,21, 500, 22000 , 500 },
80{ 14 , 1,10,22, 500, 22000 , 500 },
81{ 15 , 1,10,25, 500, 22000 , 500 },
82{ 16 , 1,10,26, 500, 22000 , 500 },
83
84{ 21 , 3,10,27, 1000, 22000 , 0 },
85{ 22 , 3,10,28, 1000, 1000 , 0 },
86{ 23 , 3,10,29, 1000, 1000 , 0 },
87{ 19 , 3,10,30, 1000, 1000 , 0 },
88
89},
90{
91{ "Niente" , { 5000 , 0 , 0, 0,0,0,0} },
92{ "ch1-bolo1" , { 5000 , 600000 , 140000, 80000, 25000, 0, 0} },
93{ "ch1-bolo2" , { 5000 , 600000 , 140000, 60000, 25000, 0, 0} },
94{ "ch1-bolo3" , { 5000 , 600000 , 140000, 65000, 25000, 0, 0} },
95{ "ch2-bolo4" , { 5000 , 600000 , 140000, 90000, 25000, 0, 0} },
96
97{ "ch2-bolo5" , { 5000 , 600000 , 140000, 100000, 25000, 0, 0} },
98{ "ch2-bolo6" , { 5000 , 600000 , 140000, 110000, 25000, 0, 0} },
99{ "Dum100mK1" , { 5000 , 588000 , 125000, 0,0,0,0} },
100{ "Dum100mK2" , { 5000 , 588000 , 125000, 0,0,0,0} },
101
102{ "Dum100mK3" , { 5000 , 1361800 , 125000, 0,0,0,0} },
103{ "Dum100mK4" , { 5000 , 1361800 , 125000, 0,0,0,0} },
104{ "Lou100mK1" , { 5000 , 5680000 , 560000, 0,0,0,0} },
105{ "Lou100mK2" , { 5000 , 5680000 , 560000, 0,0,0,0} },
106
107{ "Lou1.6K5" , { 5000 , 0 , 0, 0,0,0,0} },
108{ "Lou1.6K6" , { 5000 , 0 , 0, 0,0,0,0} },
109{ "Lou10K7" , { 5000 , 0 , 0, 0,0,0,0} },
110{ "Lou10K8" , { 5000 , 0 , 0, 0,0,0,0} },
111
112{ "R10MOhm" , { 5000 , 0 , 0, 0,0,0,0} },
113{ "bedif18" , { 5000 , 123100 , 334200, 0,0,0,0} },
114{ "v1-bedif19" , { 5000 , 123100 , 334200, 0,0,0,0} },
115{ "therm_10k" , { 45000 , 28907 , 16028 , -1327 , 1472 , 872, 0} },
116
117{ "germanium" , { 0 , 30719 , -910 ,-16389 , 2927 , 0, 0} },
118{ "therm_4k" , { 45000 , 28907 , 16028 , -1327 , 1472 , 872, 0} },
119{ "therm_1.6k" , { 45000 , 28907 , 16028 , -1327 , 1472 , 872, 0} },
120
121}
122
123};
124/*fin_param*/
125
126/* Definition Mai-Juin 1999
127{
128{ "v1-bedif1" , 1,10,1 , 200, 22000 , 200, { 5000 , 123100 , 334200,0,0,0,0} },
129{ "v1-bedif2" , 1,10,2 , 200, 22000 , 200, { 500 , 136180 , 9010,0,0,0,0} },
130{ "v1-bedif3" , 1,10,3 , 200, 22000 , 200, { 500 , 136180 , 9010,0,0,0,0} },
131{ "v1-bedif4" , 1,10,4 , 200, 22000 , 200, { 5000 , 123100 , 334200,0,0,0,0} },
132{ "v1-bedif5" , 1,10,5 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
133{ "v1-bedif6" , 1,10,6 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
134
135{ "v1-bedif7" , 1,10,9 , 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
136{ "v1-bedif8" , 1,10,10, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
137{ "v1-bedif9" , 1,10,11, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
138{ "v1-bedif10" , 1,10,12, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
139{ "v1-bedif11" , 1,10,13, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
140{ "v1-bedif12" , 1,10,14, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
141
142{ "v1-bedif13" , 1,10,17, 1000, 100000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
143{ "v1-bedif14" , 1,10,18, 1000, 470000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
144{ "bedif15" , 1,10,19, 1000, 470000 , 1000, { 500 , 58800 , 12500,0,0,0,0} },
145{ "bedif16" , 1,10,20, 1000,2200000 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
146{ "bedif17" , 1,10,21, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
147{ "bedif18" , 1,10,22, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
148
149{ "v1-bedif19" , 2,10,25, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
150{ "v1-bedif20" , 2,10,26, 1000, 4700 , 1000, { 5000 , 123100 , 334200,0,0,0,0} },
151{ "germanium" , 3,10,27, 1000, 22000 , 0, { 3500 , 17100 , 646500,0,0,0,0} },
152{ "therm_4k" , 3,10,28, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
153{ "therm_1.6k" , 3,10,29, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
154{ "therm_10k" , 3,10,30, 1000, 1000 , 0, {12000 ,1804000 , 72800,0,0,0,0} },
155
156}*/
157
158/* bolos campagne 1998-1999 */
159/*
160reg_NbSi.J, 1, 0, 1, 100, 4.7, 333, .5 ,519.6 , 8.286
161v1-231...L, 1, 0, 2, 100, 4.7, 333, .5 , 1.7 , 32.41 , 0.333 , 10 , 20.30 , 11.41
162v1-232...N, 1, 0, 3, 100, 4.7, 333,
163v1-237...E, 1, 0, 4, 100, 4.7, 333,
164
165reg_JamieO, 1, 0, 5, 100, 4.7, 101,
166
167V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
168V2-230...B, 1, 0, 7, 100, 4.7, 333, .5 , 8.26 , 26.61 , 5.10 , 7 , 9.354 , 1.026
169V2-205...Q, 1, 0, 8, 100, 4.7, 333, .518 , 81 , 25.2
170V2-208...P, 1, 0, 9, 100, 4.7, 333, .5 , 12.31 , 33.42 , 0.627 , 6.5 , 8.113 , 2.958
171
172*/
173/*bolos campagne 1997-1998 */
174/*
175
176v1-208...J, 1, 0, 1, 100, 4.7, 333, .5 , 12.31 , 33.42
177v1-232...L, 1, 0, 2, 100, 4.7, 333,
178v1-205...N, 1, 0, 3, 100, 4.7, 333, .518 , 81 , 25.2
179v1-NbSi..E, 1, 0, 4, 100, 4.7, 333, .5 ,519.6 , 8.286
180Jamie....O, 1, 0, 5, 100, 4.7, 101,
181V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
182V2-224...B, 1, 0, 7, 100, 4.7, 333, .5 ,3.43 , 26.6
183V2-230...Q, 1, 0, 8, 100, 4.7, 333, .5 , 8.26 , 26.61
184V2-231...P, 1, 0, 9, 100, 4.7, 333, .5 , 1.7 , 32.41
185
186*/
187
188
189int mode_transmission_telemesure[nb_modes_telemesure][nb_type_blocks]= {
190
191/* enregisteur de bord flash : plafond standard nominal */
192/* 0*/ { 0,10,15,50, 10,50, 0, 0, 0, 0, 0, 0, 1, 1, 1,2500, 0, 0, 0, 0},
193
194/* 1*/ { 0,10,10, 1, 10, 3, 0, 0, 0, 0, 0, 0, 1, 1, 4,2500, 0, 0, 0, 0},
195
196/* 2*/ { 0,10,05,01, 10,06, 0, 0, 0, 0, 0, 0, 1, 1, 2,2500, 0, 0, 0, 0},
197
198/* 3*/ { 0,10, 1,25, 10, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0},
199
200/* 4*/ { 0,10,15,50, 10,25, 0, 0, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
201
202/* 5*/ { 0,10,15,50, 10,25, 0, 0, 0, 0, 1, 0, 0, 0, 0,2500, 0, 0, 0, 0},
203
204/* 6*/ { 0,10,15,50, 10,50, 0, 0, 0, 1, 0, 0, 1, 0, 2,2500, 0, 0, 0, 0},
205
206/* 7*/ { 0,10,15,50,100,50,1, 1, 0, 0, 0, 0, 1, 1, 1,2500, 0, 0, 0, 0},
207
208/* 8*/ { 0,10,15,50,100,50,1, 1, 1, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0},
209
210/* 9*/ { 0,10, 1, 1,100, 1,0, 0, 0, 0, 0, 0, 1, 0, 0,2500, 0, 0, 0, 0}
211
212 };
213
214
215
216int mode_transmission_flash[nb_modes_flash][nb_type_blocks]= {
217
218
219/* enregisteur de bord flash : nominal */
220/* 0*/ { 0,50,15,25, 10,25, 0, 0, 0, 1, 0, 0, 1, 0, 1,2500, 0, 0, 0, 0} ,
221
222/* enregisteur de bord flash : minimum */
223/* 1*/ { 0,50,50,50,50,100, 0, 0, 0, 0, 0, 0, 0, 0, 0,2500, 0, 0, 0, 0} ,
224
225/* enregisteur de bord flash : rien */
226/* 2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} };
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246/*debut_nom_reglage*/
247/* 0->a chaud complet*/
248/* 1->a froid pour V(I)*/
249/* 2->cc*/
250/* 3->a chaud complet*/
251/* 4->chaud avec synchro*/
252/* 5->reglage 5 */
253/* 6->reglage 6 */
254/* 7->reglage 7 */
255/*fin_nom_reglage*/
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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308reglage_bolo reglage_standard[8]={{
309
310
311/*debut reglage 0 */
312#ifdef programme
313{30,76,9,1},{
314{20,0}
315,{-1148225771,229380}
316,{-1148367339,294916}
317,{20,0}
318,{21,221185}
319,{21,0}
320,{21,245761}
321,{20,0}
322,{21,245761}
323,{277,253953}
324,{20,0}
325,{21,204801}
326,{21,19457}
327,{21,1}
328,{11501589,8708}
329,{20,0}
330,{-100647916,0}
331,{1015828,0}
332,{20,0}
333,{20,0}
334,{1024022,0}
335,{25622,0}
336,{-100395499,0}
337,{25622,0}
338},{
339{0,0,128,1}
340,{0,0,128,4}
341,{0,0,128,4}
342,{0,0,128,3}
343,{0,0,128,4}
344,{0,0,128,4}
345},{
346{0,1,9,1,0,0,0}
347,{0,1,9,1,0,0,0}
348,{0,1,9,1,0,0,0}
349,{0,1,9,1,0,0,0}
350},{1,3,129,108,3,126,104,88}
351#else
352{1,9,76,30},{
353{20,0}
354,{-1148225771,229380}
355,{-1148367339,294916}
356,{20,0}
357,{21,221185}
358,{21,0}
359,{21,245761}
360,{20,0}
361,{21,245761}
362,{277,253953}
363,{20,0}
364,{21,204801}
365,{21,19457}
366,{21,1}
367,{11501589,8708}
368,{20,0}
369,{-100647916,0}
370,{1015828,0}
371,{20,0}
372,{20,0}
373,{1024022,0}
374,{25622,0}
375,{-100395499,0}
376,{25622,0}
377},{
378{1,128,0,0}
379,{4,128,0,0}
380,{4,128,0,0}
381,{3,128,0,0}
382,{4,128,0,0}
383,{4,128,0,0}
384},{
385{1,9,1,0,0,0,0}
386,{1,9,1,0,0,0,0}
387,{1,9,1,0,0,0,0}
388,{1,9,1,0,0,0,0}
389},{108,129,3,1,88,104,126,3}
390#endif
391/*fin_reglage*/
392
393},{
394
395/*debut reglage 1 */
396#ifdef programme
397{31,76,9,1},{
398{20,0}
399,{-1148225771,229380}
400,{-1148367339,294916}
401,{20,0}
402,{2127959573,221185}
403,{21,0}
404,{2127892757,245761}
405,{20,0}
406,{2127991317,245761}
407,{2127996181,253953}
408,{20,0}
409,{2128584725,204801}
410,{2127780885,19457}
411,{2127795221,1}
412,{11501589,8708}
413,{20,0}
414,{-100647916,0}
415,{1015828,0}
416,{20,0}
417,{20,0}
418,{12822,0}
419,{25622,0}
420,{-100660714,0}
421,{25622,0}
422},{
423{2,21,25,1}
424,{0,20,0,4}
425,{0,20,0,4}
426,{0,21,23,3}
427,{0,20,0,4}
428,{0,20,0,4}
429},{
430{0,1,9,1,0,0,0}
431,{0,1,9,1,0,0,0}
432,{0,1,9,1,0,0,0}
433,{0,1,9,1,0,0,0}
434},{129,3,129,108,3,126,104,88}
435#else
436{1,9,76,31},{
437{20,0}
438,{-1148225771,229380}
439,{-1148367339,294916}
440,{20,0}
441,{2127959573,221185}
442,{21,0}
443,{2127892757,245761}
444,{20,0}
445,{2127991317,245761}
446,{2127996181,253953}
447,{20,0}
448,{2128584725,204801}
449,{2127780885,19457}
450,{2127795221,1}
451,{11501589,8708}
452,{20,0}
453,{-100647916,0}
454,{1015828,0}
455,{20,0}
456,{20,0}
457,{12822,0}
458,{25622,0}
459,{-100660714,0}
460,{25622,0}
461},{
462{1,25,21,2}
463,{4,0,20,0}
464,{4,0,20,0}
465,{3,23,21,0}
466,{4,0,20,0}
467,{4,0,20,0}
468},{
469{1,9,1,0,0,0,0}
470,{1,9,1,0,0,0,0}
471,{1,9,1,0,0,0,0}
472,{1,9,1,0,0,0,0}
473},{108,129,3,129,88,104,126,3}
474#endif
475/*fin_reglage*/
476
477},{
478
479/*debut reglage 2 */
480#ifdef programme
481{197,191,175,185},{
482{0,0}
483,{0,0}
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},{
507{106,98,93,71}
508,{66,74,87,66}
509,{48,46,38,33}
510,{40,41,33,26}
511,{25,29,40,57}
512,{63,62,71,80}
513},{
514{83,79,75,75,92,112,31100}
515,{125,126,117,113,107,94,20315}
516,{108,116,122,124,117,120,32117}
517,{110,99,94,98,107,93,17217}
518},{88,82,94,108,111,126,104,88}
519#else
520{185,175,191,197},{
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{20,0}
567,{-1149239274,229380}
568,{-1149239275,294916}
569,{20,0}
570,{20,221185}
571,{21,0}
572,{20,245761}
573,{20,0}
574,{20,245761}
575,{276,253953}
576,{20,0}
577,{20,204801}
578,{20,19457}
579,{20,1}
580,{10486037,8708}
581,{20,0}
582,{-100647916,0}
583,{1015828,0}
584,{20,0}
585,{20,0}
586,{1024022,0}
587,{25622,0}
588,{-100660714,0}
589,{25622,0}
590},{
591{0,20,0,1}
592,{0,20,0,4}
593,{0,20,0,4}
594,{2,20,0,3}
595,{0,20,0,4}
596,{0,20,0,4}
597},{
598{0,1,9,1,0,0,0}
599,{0,1,9,1,0,0,0}
600,{0,1,9,1,0,0,0}
601,{0,1,9,1,0,0,0}
602},{1,3,129,108,3,126,104,88}
603#else
604{1,9,76,30},{
605{20,0}
606,{-1149239274,229380}
607,{-1149239275,294916}
608,{20,0}
609,{20,221185}
610,{21,0}
611,{20,245761}
612,{20,0}
613,{20,245761}
614,{276,253953}
615,{20,0}
616,{20,204801}
617,{20,19457}
618,{20,1}
619,{10486037,8708}
620,{20,0}
621,{-100647916,0}
622,{1015828,0}
623,{20,0}
624,{20,0}
625,{1024022,0}
626,{25622,0}
627,{-100660714,0}
628,{25622,0}
629},{
630{1,0,20,0}
631,{4,0,20,0}
632,{4,0,20,0}
633,{3,0,20,2}
634,{4,0,20,0}
635,{4,0,20,0}
636},{
637{1,9,1,0,0,0,0}
638,{1,9,1,0,0,0,0}
639,{1,9,1,0,0,0,0}
640,{1,9,1,0,0,0,0}
641},{108,129,3,1,88,104,126,3}
642#endif
643/*fin_reglage*/
644
645},{
646
647/*debut reglage 4 */
648#ifdef programme
649{30,76,9,1},{
650{20,0}
651,{-1148225771,229380}
652,{-1148367339,294916}
653,{20,0}
654,{21,221185}
655,{21,0}
656,{21,245761}
657,{20,0}
658,{21,245761}
659,{277,253953}
660,{20,0}
661,{21,204801}
662,{21,19457}
663,{21,1}
664,{11501589,8708}
665,{20,0}
666,{-100647916,0}
667,{1015828,0}
668,{20,0}
669,{20,0}
670,{1024022,0}
671,{25622,0}
672,{-100395499,0}
673,{25622,0}
674},{
675{0,0,128,1}
676,{0,0,128,4}
677,{0,0,128,4}
678,{0,0,128,3}
679,{0,0,128,4}
680,{0,0,128,4}
681},{
682{0,1,9,1,0,0,0}
683,{0,1,9,1,0,0,0}
684,{0,1,9,1,0,0,0}
685,{0,1,9,1,0,0,0}
686},{1,3,129,108,3,126,104,88}
687#else
688{1,9,76,30},{
689{20,0}
690,{-1148225771,229380}
691,{-1148367339,294916}
692,{20,0}
693,{21,221185}
694,{21,0}
695,{21,245761}
696,{20,0}
697,{21,245761}
698,{277,253953}
699,{20,0}
700,{21,204801}
701,{21,19457}
702,{21,1}
703,{11501589,8708}
704,{20,0}
705,{-100647916,0}
706,{1015828,0}
707,{20,0}
708,{20,0}
709,{1024022,0}
710,{25622,0}
711,{-100395499,0}
712,{25622,0}
713},{
714{1,128,0,0}
715,{4,128,0,0}
716,{4,128,0,0}
717,{3,128,0,0}
718,{4,128,0,0}
719,{4,128,0,0}
720},{
721{1,9,1,0,0,0,0}
722,{1,9,1,0,0,0,0}
723,{1,9,1,0,0,0,0}
724,{1,9,1,0,0,0,0}
725},{108,129,3,1,88,104,126,3}
726#endif
727/*fin_reglage*/
728
729},{
730
731/*debut reglage 5 */
732#ifdef programme
733{197,191,175,185},{
734{0,0}
735,{0,0}
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},{
759{106,98,93,71}
760,{66,74,87,66}
761,{48,46,38,33}
762,{40,41,33,26}
763,{25,29,40,57}
764,{63,62,71,80}
765},{
766{83,79,75,75,92,112,31100}
767,{125,126,117,113,107,94,20315}
768,{108,116,122,124,117,120,32117}
769,{110,99,94,98,107,93,17217}
770},{88,82,94,108,111,126,104,88}
771#else
772{185,175,191,197},{
773{0,0}
774,{0,0}
775,{0,0}
776,{0,0}
777,{0,0}
778,{0,0}
779,{0,0}
780,{0,0}
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},{
798{71,93,98,106}
799,{66,87,74,66}
800,{33,38,46,48}
801,{26,33,41,40}
802,{57,40,29,25}
803,{80,71,62,63}
804},{
805{75,75,79,83,31100,112,92}
806,{113,117,126,125,20315,94,107}
807,{124,122,116,108,32117,120,117}
808,{98,94,99,110,17217,93,107}
809},{108,94,82,88,88,104,126,111}
810#endif
811/*fin_reglage*/
812
813},{
814
815/*debut reglage 6 */
816#ifdef programme
817{197,191,175,185},{
818{0,0}
819,{0,0}
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},{
843{106,98,93,71}
844,{66,74,87,66}
845,{48,46,38,33}
846,{40,41,33,26}
847,{25,29,40,57}
848,{63,62,71,80}
849},{
850{83,79,75,75,92,112,31100}
851,{125,126,117,113,107,94,20315}
852,{108,116,122,124,117,120,32117}
853,{110,99,94,98,107,93,17217}
854},{88,82,94,108,111,126,104,88}
855#else
856{185,175,191,197},{
857{0,0}
858,{0,0}
859,{0,0}
860,{0,0}
861,{0,0}
862,{0,0}
863,{0,0}
864,{0,0}
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},{
882{71,93,98,106}
883,{66,87,74,66}
884,{33,38,46,48}
885,{26,33,41,40}
886,{57,40,29,25}
887,{80,71,62,63}
888},{
889{75,75,79,83,31100,112,92}
890,{113,117,126,125,20315,94,107}
891,{124,122,116,108,32117,120,117}
892,{98,94,99,110,17217,93,107}
893},{108,94,82,88,88,104,126,111}
894#endif
895/*fin_reglage*/
896
897},{
898
899/*debut reglage 7 */
900#ifdef programme
901{197,191,175,185},{
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,{0,0}
924,{0,0}
925,{0,0}
926},{
927{106,98,93,71}
928,{66,74,87,66}
929,{48,46,38,33}
930,{40,41,33,26}
931,{25,29,40,57}
932,{63,62,71,80}
933},{
934{83,79,75,75,92,112,31100}
935,{125,126,117,113,107,94,20315}
936,{108,116,122,124,117,120,32117}
937,{110,99,94,98,107,93,17217}
938},{88,82,94,108,111,126,104,88}
939#else
940{185,175,191,197},{
941{0,0}
942,{0,0}
943,{0,0}
944,{0,0}
945,{0,0}
946,{0,0}
947,{0,0}
948,{0,0}
949,{0,0}
950,{0,0}
951,{0,0}
952,{0,0}
953,{0,0}
954,{0,0}
955,{0,0}
956,{0,0}
957,{0,0}
958,{0,0}
959,{0,0}
960,{0,0}
961,{0,0}
962,{0,0}
963,{0,0}
964,{0,0}
965},{
966{71,93,98,106}
967,{66,87,74,66}
968,{33,38,46,48}
969,{26,33,41,40}
970,{57,40,29,25}
971,{80,71,62,63}
972},{
973{75,75,79,83,31100,112,92}
974,{113,117,126,125,20315,94,107}
975,{124,122,116,108,32117,120,117}
976,{98,94,99,110,17217,93,107}
977},{108,94,82,88,88,104,126,111}
978#endif
979/*fin_reglage*/
980
981} };
982
983/* ------------------------------------ corps des fonctions ------------------------------ */
984/* -------------------------------------------------------------------------------------------- */
985
986
987
988unsigned int4 val_long(char x)
989{
990unsigned int4 a,xl;
991char aa;
992aa=x-2;
993a=aa;
994if(x<3) xl=x; else xl=((a&1) + 2)<<(a>>1);
995return(xl);
996}
997
998
999double val_double(char x)
1000{
1001unsigned long a,xl;
1002if(x<0) x=-x; a=x; if(!a) xl=0; else xl=((a&1) + 2)<<(a>>1);
1003if(x>0) return(1e-4*(double)xl); else return(-1e-4*(double)xl);
1004}
1005
1006int new_val_dac(int a,char code)
1007{
1008if(code&0x80) a=(code&0x7f) <<5 ;
1009else {
1010 if(code&0x40) a+=code&0x3f;
1011 else a-=code&0x3f;
1012 }
1013return(a);
1014}
1015
1016
1017
1018
1019int calcul_somme_block(block_type_modele* blk,int longueur)
1020{
1021int i,so=0;;
1022for(i=0;i<(longueur/4-4);i++) so^=(int)blk->mot[i];
1023/* somme sur tous les mots internes : on exclus le dbut, les codes et la fin */
1024return((so^(so>>16))&0xffff);
1025}
1026
1027
1028
1029
1030void valide_block(block_type_modele* blk,int type,int block_num)
1031{
1032int somme,longueur;
1033def_long_block
1034longueur=long_block[type];
1035/*printf("valide block adresse %x type %d numblock %d longueur=%d \n" */
1036/* ,(unsigned)blk,type,block_num,longueur);*/
1037blk->debut = debut_block_mesure;
1038blk->code2 = (((long)block_num) & 0xffffff ) | ( (((long)type)<<24)&0xff000000 );
1039
1040blk->mot[longueur/4-4] = fin_block_mesure;
1041somme=calcul_somme_block(blk,longueur);
1042blk->code1 = (((long)longueur)<<16) | somme;
1043}
1044
1045
1046
1047
1048int verifie_block(block_type_modele* blk)
1049{
1050int type,lg,som;
1051def_long_block
1052if(blk->debut != debut_block_mesure) return(block_debut_erreur);
1053type=type_block(blk); if( (type<0) ||(type>=nb_type_blocks) ) return(block_type_inconnu);
1054lg=longueur_block(blk); if( lg != long_block[type] ) return(block_longueur_erreur);
1055if( blk->mot[(lg/4)-4] != fin_block_mesure) return(block_fin_erreur);
1056som=calcul_somme_block(blk,lg); if( som!= somme_block(blk)) return(block_somme_erreur);
1057return(block_correct);
1058}
1059
1060
1061int verifie_block_printf(block_type_modele* blk)
1062{
1063int type,lg,som;
1064def_long_block
1065def_nom_block
1066if(blk->debut != debut_block_mesure)
1067 {
1068 printf(" erreur dans le code debut de block \n");
1069 return(block_debut_erreur);
1070 }
1071
1072type=type_block(blk);
1073if( (type<0) || (type>nb_type_blocks) )
1074 {
1075 printf(" block de type %d inconnu\n",type);
1076 return(block_type_inconnu);
1077 }
1078
1079lg=longueur_block(blk);
1080if( lg!=long_block[type] )
1081 {
1082 printf(" block type %s erreur de longueur (nominal=%d , dans le block=%d \n"
1083 ,nom_block[type],long_block[type],lg);
1084 return(block_longueur_erreur);
1085 }
1086
1087som=calcul_somme_block(blk,lg);
1088if( som!=somme_block(blk) )
1089 {
1090 printf(" block type %s : erreur de somme (calculee=%d , dans le block=%d \n"
1091 ,nom_block[type],som,somme_block(blk) );
1092 return(block_somme_erreur);
1093 }
1094
1095if(blk->mot[(lg/4)-4] != fin_block_mesure)
1096 {
1097 printf(" block type %s erreur de code fin de block : trouve %x au lieu de %x \n"
1098 ,nom_block[type],(int)blk->mot[(lg/4)-4],fin_block_mesure);
1099 return(block_fin_erreur);
1100 }
1101
1102return(block_correct);
1103}
1104
1105
1106
1107
1108
Note: See TracBrowser for help on using the repository browser.