source: Sophya/trunk/Poubelle/archediab.old/archeops.c@ 645

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

archediab 27

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