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

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

archediab 26

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