1 | #include "manip.h"
|
---|
2 | #include "archeops.h"
|
---|
3 |
|
---|
4 |
|
---|
5 | /********** coefficients pour les mesures bolo ********************************/
|
---|
6 | /* toutes les puissances en pW */
|
---|
7 | /* -1- loi de reponse thermique des bolos avec R en ohms et T en Kelvin */
|
---|
8 | /* */
|
---|
9 | /* T = coef2 * ( ln ( R / coef1) ** ( -1 / coef0 ) */
|
---|
10 | /* */
|
---|
11 | /* -2- fuite thermique du bolo coef 3,4 */
|
---|
12 | /* */
|
---|
13 | /* Ptot = coef3 * ( (10*Tb) ** coef4 - (10*Tcryo) ** coef4 ) */
|
---|
14 | /* */
|
---|
15 | /* -3- calcul empirique de Pciel et de tau coef 5,6 */
|
---|
16 | /* */
|
---|
17 | /* Pciel = coef5 - Pelec coef5= I * Ai (tables xavier) */
|
---|
18 | /* tau = - ln ( 1 + Pciel / coef6 ) coef6= I * Bi (tables xavier) */
|
---|
19 | /* */
|
---|
20 | /**************************************************************************************/
|
---|
21 |
|
---|
22 |
|
---|
23 | /**************************************************************************************/
|
---|
24 | /* */
|
---|
25 | /* pour les MLPA : gain = 100 diviseur = 101 ou 330 */
|
---|
26 | /* pour les bebodiff : gain = diviseur = 100Kohm / R preampli */
|
---|
27 | /* pour les bebodiff : la capa est corrigee d'un facteur 0.868 */
|
---|
28 | /* pour les cartes modifiees : mettre diviseur=0 */
|
---|
29 | /* et capa = la resistance de chage en Megohm */
|
---|
30 | /* */
|
---|
31 | /**************************************************************************************/
|
---|
32 |
|
---|
33 |
|
---|
34 | /* nom , on/off , 0 = MLPA , N° bolo , gain_pa , capa*1000 , diviseur , coef*10000
|
---|
35 | /* , 0 ou 1 , 2..8 = BEBO , hard , , 4700 , 333 ,
|
---|
36 | /* 10 = Bediff , , ,
|
---|
37 |
|
---|
38 | /* pour les bediff (code 10) le n° de bolo est N° de bebo*8 + numero dans la bebo
|
---|
39 | /* soit : 1 2 3 4 5 6 .. 9 10 11 12 13 14 .. 17 18 19 20 21 22 .. etc
|
---|
40 |
|
---|
41 |
|
---|
42 | /*debut_param*/
|
---|
43 | /*---------------------------------- fenetre : -----------------------------------*/
|
---|
44 |
|
---|
45 | param_bolo parametr={24,24,36,88,18,
|
---|
46 |
|
---|
47 | {
|
---|
48 | { "v1-bedif1" , 1,10,1 , 200, 22000, 200, { 5000 , 123100 , 334200 } },
|
---|
49 | { "v1-bedif2" , 1,10,2 , 200, 22000, 200, { 5000 , 12.31 , 33.42 } },
|
---|
50 | { "v1-bedif3" , 1,10,3 , 200, 22000, 200, { 5000 , 50.0 , 14.0 } },
|
---|
51 | { "v1-bedif4" , 1,10,4 , 200, 22000, 200, { 5000 , 12.31 , 33.42 } },
|
---|
52 | { "v1-bedif5" , 1,10,5 , 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
53 | { "v1-bedif6" , 1,10,6 , 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
54 |
|
---|
55 | { "v1-bedif7" , 1,10,9 , 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
56 | { "v1-bedif8" , 1,10,10, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
57 | { "v1-bedif9" , 1,10,11, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
58 | { "v1-bedif10" , 1,10,12, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
59 | { "v1-bedif11" , 1,10,13, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
60 | { "v1-bedif12" , 1,10,14, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
61 |
|
---|
62 | { "v1-bedif13" , 1,10,17, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
63 | { "v1-bedif14" , 1,10,18, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
64 | { "germanium" , 3,10,19, 1000, 22000 , 0, { 5000 , 12.31 , 33.42 } },
|
---|
65 | { "therm_4k" , 3,10,20, 1000, 1000 , 0, { 5000 , 12.31 , 33.42 } },
|
---|
66 | { "therm_1.6k" , 3,10,21, 1000, 1000 , 0, { 5000 , 12.31 , 33.42 } },
|
---|
67 | { "therm_10k" , 3,10,22, 1000, 1000 , 0, { 5000 , 12.31 , 33.42 } },
|
---|
68 |
|
---|
69 | { "v1-bedif19" , 2,10,25 , 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
70 | { "v1-bedif20" , 2,10,26, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
71 | { "v1-bedif21" , 2,10,27, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
72 | { "v1-bedif22" , 2,10,28, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
73 | { "v1-bedif23" , 2,10,29, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } },
|
---|
74 | { "v1-bedif24" , 2,10,30, 1000, 4700, 1000, { 5000 , 12.31 , 33.42 } }
|
---|
75 |
|
---|
76 | }
|
---|
77 | };
|
---|
78 | /*fin_param*/
|
---|
79 |
|
---|
80 |
|
---|
81 |
|
---|
82 | /* bolos campagne 1998-1999 */
|
---|
83 | /*
|
---|
84 | reg_NbSi.J, 1, 0, 1, 100, 4.7, 333, .5 ,519.6 , 8.286
|
---|
85 | v1-231...L, 1, 0, 2, 100, 4.7, 333, .5 , 1.7 , 32.41 , 0.333 , 10 , 20.30 , 11.41
|
---|
86 | v1-232...N, 1, 0, 3, 100, 4.7, 333,
|
---|
87 | v1-237...E, 1, 0, 4, 100, 4.7, 333,
|
---|
88 |
|
---|
89 | reg_JamieO, 1, 0, 5, 100, 4.7, 101,
|
---|
90 |
|
---|
91 | V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
|
---|
92 | V2-230...B, 1, 0, 7, 100, 4.7, 333, .5 , 8.26 , 26.61 , 5.10 , 7 , 9.354 , 1.026
|
---|
93 | V2-205...Q, 1, 0, 8, 100, 4.7, 333, .518 , 81 , 25.2
|
---|
94 | V2-208...P, 1, 0, 9, 100, 4.7, 333, .5 , 12.31 , 33.42 , 0.627 , 6.5 , 8.113 , 2.958
|
---|
95 |
|
---|
96 | */
|
---|
97 | /*bolos campagne 1997-1998 */
|
---|
98 | /*
|
---|
99 |
|
---|
100 | v1-208...J, 1, 0, 1, 100, 4.7, 333, .5 , 12.31 , 33.42
|
---|
101 | v1-232...L, 1, 0, 2, 100, 4.7, 333,
|
---|
102 | v1-205...N, 1, 0, 3, 100, 4.7, 333, .518 , 81 , 25.2
|
---|
103 | v1-NbSi..E, 1, 0, 4, 100, 4.7, 333, .5 ,519.6 , 8.286
|
---|
104 | Jamie....O, 1, 0, 5, 100, 4.7, 101,
|
---|
105 | V2-NbSi..H, 1, 0, 6, 100, 4.7, 101, .5 ,433.8 , 9.25
|
---|
106 | V2-224...B, 1, 0, 7, 100, 4.7, 333, .5 ,3.43 , 26.6
|
---|
107 | V2-230...Q, 1, 0, 8, 100, 4.7, 333, .5 , 8.26 , 26.61
|
---|
108 | V2-231...P, 1, 0, 9, 100, 4.7, 333, .5 , 1.7 , 32.41
|
---|
109 |
|
---|
110 | */
|
---|
111 |
|
---|
112 |
|
---|
113 |
|
---|
114 |
|
---|
115 |
|
---|
116 | /*debut_nom_reglage*/
|
---|
117 | /* 0->aa*/
|
---|
118 | /* 1->bb*/
|
---|
119 | /* 2->cc*/
|
---|
120 | /* 3->reglage 3 */
|
---|
121 | /* 4->reglage 4 */
|
---|
122 | /* 5->reglage 5 */
|
---|
123 | /* 6->reglage 6 */
|
---|
124 | /* 7->reglage 7 */
|
---|
125 | /*fin_nom_reglage*/
|
---|
126 |
|
---|
127 |
|
---|
128 |
|
---|
129 |
|
---|
130 |
|
---|
131 |
|
---|
132 |
|
---|
133 | reglage_bolo reglage_standard[8]={{
|
---|
134 |
|
---|
135 |
|
---|
136 | /*debut reglage 0 */
|
---|
137 | {30,76,9,1},
|
---|
138 | {0
|
---|
139 | ,10
|
---|
140 | ,1
|
---|
141 | ,3
|
---|
142 | ,10
|
---|
143 | ,2
|
---|
144 | ,0
|
---|
145 | ,0
|
---|
146 | ,1
|
---|
147 | ,0
|
---|
148 | ,0
|
---|
149 | ,0
|
---|
150 | ,0
|
---|
151 | ,0
|
---|
152 | ,0
|
---|
153 | ,0
|
---|
154 | ,0
|
---|
155 | ,0
|
---|
156 | ,0
|
---|
157 | ,0
|
---|
158 | },{
|
---|
159 | {22,100663296}
|
---|
160 | ,{-100646890,1}
|
---|
161 | ,{-100646890,1}
|
---|
162 | ,{22,0}
|
---|
163 | ,{-100638698,1}
|
---|
164 | ,{22,253952}
|
---|
165 | ,{-100646890,1}
|
---|
166 | ,{22,0}
|
---|
167 | ,{-100646890,1}
|
---|
168 | ,{-100646890,1}
|
---|
169 | ,{22,0}
|
---|
170 | ,{235388950,221185}
|
---|
171 | ,{20,0}
|
---|
172 | ,{20,0}
|
---|
173 | ,{16406,0}
|
---|
174 | ,{24598,0}
|
---|
175 | ,{22,0}
|
---|
176 | ,{24598,0}
|
---|
177 | },{
|
---|
178 | {1,22,0,1}
|
---|
179 | ,{0,20,0,1}
|
---|
180 | ,{0,20,0,1}
|
---|
181 | ,{0,20,0,1}
|
---|
182 | ,{0,20,0,1}
|
---|
183 | ,{0,20,0,1}
|
---|
184 | },{
|
---|
185 | {0,1,9,1,0,0,0}
|
---|
186 | ,{0,1,9,1,0,0,0}
|
---|
187 | ,{0,1,9,1,0,0,0}
|
---|
188 | ,{0,1,9,1,0,0,0}
|
---|
189 | },{0,0,0,0,0,0,0,0}
|
---|
190 | /*fin_reglage*/
|
---|
191 |
|
---|
192 | },{
|
---|
193 |
|
---|
194 | /*debut reglage 1 */
|
---|
195 | {30,76,9,1},
|
---|
196 | {0
|
---|
197 | ,10
|
---|
198 | ,1
|
---|
199 | ,3
|
---|
200 | ,10
|
---|
201 | ,2
|
---|
202 | ,0
|
---|
203 | ,0
|
---|
204 | ,1
|
---|
205 | ,0
|
---|
206 | ,0
|
---|
207 | ,0
|
---|
208 | ,0
|
---|
209 | ,0
|
---|
210 | ,0
|
---|
211 | ,0
|
---|
212 | ,0
|
---|
213 | ,0
|
---|
214 | ,0
|
---|
215 | ,0
|
---|
216 | },{
|
---|
217 | {22,100663296}
|
---|
218 | ,{-100646890,1}
|
---|
219 | ,{-100646890,1}
|
---|
220 | ,{22,0}
|
---|
221 | ,{-100638698,1}
|
---|
222 | ,{22,253952}
|
---|
223 | ,{-100646890,1}
|
---|
224 | ,{22,0}
|
---|
225 | ,{-100646890,1}
|
---|
226 | ,{-100646890,1}
|
---|
227 | ,{22,0}
|
---|
228 | ,{235388950,221185}
|
---|
229 | ,{20,0}
|
---|
230 | ,{20,0}
|
---|
231 | ,{16406,0}
|
---|
232 | ,{24598,0}
|
---|
233 | ,{22,0}
|
---|
234 | ,{24598,0}
|
---|
235 | },{
|
---|
236 | {1,22,0,1}
|
---|
237 | ,{0,20,0,1}
|
---|
238 | ,{0,20,0,1}
|
---|
239 | ,{0,20,0,1}
|
---|
240 | ,{0,20,0,1}
|
---|
241 | ,{0,20,0,1}
|
---|
242 | },{
|
---|
243 | {0,1,9,1,0,0,0}
|
---|
244 | ,{0,1,9,1,0,0,0}
|
---|
245 | ,{0,1,9,1,0,0,0}
|
---|
246 | ,{0,1,9,1,0,0,0}
|
---|
247 | },{0,0,0,0,0,0,0,0}
|
---|
248 | /*fin_reglage*/
|
---|
249 |
|
---|
250 | },{
|
---|
251 |
|
---|
252 | /*debut reglage 2 */
|
---|
253 | {31,76,9,0},
|
---|
254 | {0
|
---|
255 | ,-14
|
---|
256 | ,-31
|
---|
257 | ,-63
|
---|
258 | ,-83
|
---|
259 | ,-103
|
---|
260 | ,-122
|
---|
261 | ,127
|
---|
262 | ,1
|
---|
263 | ,97
|
---|
264 | ,14
|
---|
265 | ,-32
|
---|
266 | ,-93
|
---|
267 | ,-87
|
---|
268 | ,-72
|
---|
269 | ,-80
|
---|
270 | ,-101
|
---|
271 | ,-112
|
---|
272 | ,-113
|
---|
273 | ,-121
|
---|
274 | },{
|
---|
275 | {22,100663296}
|
---|
276 | ,{1040629782,204800}
|
---|
277 | ,{1040834582,221184}
|
---|
278 | ,{22,0}
|
---|
279 | ,{-100450282,2}
|
---|
280 | ,{22,253952}
|
---|
281 | ,{-100458474,2}
|
---|
282 | ,{22,0}
|
---|
283 | ,{-100442090,2}
|
---|
284 | ,{-100253674,253954}
|
---|
285 | ,{22,0}
|
---|
286 | ,{303013910,221184}
|
---|
287 | ,{20,0}
|
---|
288 | ,{20,0}
|
---|
289 | ,{9238,0}
|
---|
290 | ,{24598,301989888}
|
---|
291 | ,{22,0}
|
---|
292 | ,{24598,0}
|
---|
293 | ,{0,0}
|
---|
294 | ,{0,0}
|
---|
295 | ,{0,0}
|
---|
296 | ,{0,0}
|
---|
297 | ,{0,0}
|
---|
298 | ,{0,0}
|
---|
299 | },{
|
---|
300 | {-15,-9,-13,-38}
|
---|
301 | ,{-83,-109,-90,-68}
|
---|
302 | ,{-99,-101,-67,-61}
|
---|
303 | ,{-64,-60,-38,-19}
|
---|
304 | ,{-28,-57,-77,-75}
|
---|
305 | ,{-66,-55,-51,-68}
|
---|
306 | },{
|
---|
307 | {31,76,9,0,0,-35,-4643}
|
---|
308 | ,{-55,-77,-69,-55,-44,-43,-12336}
|
---|
309 | ,{-56,-85,-128,99,111,-116,-28030}
|
---|
310 | ,{105,107,101,101,106,111,31615}
|
---|
311 | },{-102,-88,-94,-113,-126,101,73,70}
|
---|
312 | /*fin_reglage*/
|
---|
313 |
|
---|
314 | },{
|
---|
315 |
|
---|
316 | /*debut reglage 3 */
|
---|
317 | {31,76,9,0},
|
---|
318 | {0
|
---|
319 | ,-14
|
---|
320 | ,-31
|
---|
321 | ,-63
|
---|
322 | ,-83
|
---|
323 | ,-103
|
---|
324 | ,-122
|
---|
325 | ,127
|
---|
326 | ,1
|
---|
327 | ,99
|
---|
328 | ,13
|
---|
329 | ,96
|
---|
330 | ,-93
|
---|
331 | ,-87
|
---|
332 | ,-72
|
---|
333 | ,-80
|
---|
334 | ,-101
|
---|
335 | ,-112
|
---|
336 | ,-113
|
---|
337 | ,-121
|
---|
338 | },{
|
---|
339 | {22,100663296}
|
---|
340 | ,{1040629782,204800}
|
---|
341 | ,{1040834582,221184}
|
---|
342 | ,{22,0}
|
---|
343 | ,{-100450282,2}
|
---|
344 | ,{22,253952}
|
---|
345 | ,{-100458474,2}
|
---|
346 | ,{22,0}
|
---|
347 | ,{-100442090,2}
|
---|
348 | ,{-100253674,253954}
|
---|
349 | ,{22,0}
|
---|
350 | ,{303013910,221184}
|
---|
351 | ,{20,0}
|
---|
352 | ,{20,0}
|
---|
353 | ,{9238,0}
|
---|
354 | ,{24598,301989888}
|
---|
355 | ,{22,0}
|
---|
356 | ,{24598,0}
|
---|
357 | ,{0,0}
|
---|
358 | ,{0,0}
|
---|
359 | ,{0,0}
|
---|
360 | ,{0,0}
|
---|
361 | ,{0,0}
|
---|
362 | ,{0,0}
|
---|
363 | },{
|
---|
364 | {-15,-9,-13,-38}
|
---|
365 | ,{-83,-109,-90,-68}
|
---|
366 | ,{-99,-101,-67,-61}
|
---|
367 | ,{-64,-60,-38,-19}
|
---|
368 | ,{-28,-57,-77,-75}
|
---|
369 | ,{-66,-55,-51,-68}
|
---|
370 | },{
|
---|
371 | {31,76,9,0,0,-35,-4643}
|
---|
372 | ,{-55,-77,-69,-55,-44,-43,-12336}
|
---|
373 | ,{-56,-85,-128,99,111,-116,-28030}
|
---|
374 | ,{105,107,101,101,106,111,31615}
|
---|
375 | },{-102,-88,-94,-113,-126,101,73,70}
|
---|
376 | /*fin_reglage*/
|
---|
377 |
|
---|
378 | },{
|
---|
379 |
|
---|
380 | /*debut reglage 4 */
|
---|
381 | {31,76,9,0},
|
---|
382 | {0
|
---|
383 | ,-14
|
---|
384 | ,-31
|
---|
385 | ,-63
|
---|
386 | ,-83
|
---|
387 | ,-103
|
---|
388 | ,-122
|
---|
389 | ,127
|
---|
390 | ,1
|
---|
391 | ,99
|
---|
392 | ,13
|
---|
393 | ,112
|
---|
394 | ,-93
|
---|
395 | ,-87
|
---|
396 | ,-72
|
---|
397 | ,-80
|
---|
398 | ,-101
|
---|
399 | ,-112
|
---|
400 | ,-113
|
---|
401 | ,-121
|
---|
402 | },{
|
---|
403 | {22,100663296}
|
---|
404 | ,{1040629782,204800}
|
---|
405 | ,{1040834582,221184}
|
---|
406 | ,{22,0}
|
---|
407 | ,{-100450282,2}
|
---|
408 | ,{22,253952}
|
---|
409 | ,{-100458474,2}
|
---|
410 | ,{22,0}
|
---|
411 | ,{-100442090,2}
|
---|
412 | ,{-100253674,253954}
|
---|
413 | ,{22,0}
|
---|
414 | ,{303013910,221184}
|
---|
415 | ,{20,0}
|
---|
416 | ,{20,0}
|
---|
417 | ,{9238,0}
|
---|
418 | ,{24598,301989888}
|
---|
419 | ,{22,0}
|
---|
420 | ,{24598,0}
|
---|
421 | ,{0,0}
|
---|
422 | ,{0,0}
|
---|
423 | ,{0,0}
|
---|
424 | ,{0,0}
|
---|
425 | ,{0,0}
|
---|
426 | ,{0,0}
|
---|
427 | },{
|
---|
428 | {-15,-9,-13,-38}
|
---|
429 | ,{-83,-109,-90,-68}
|
---|
430 | ,{-99,-101,-67,-61}
|
---|
431 | ,{-64,-60,-38,-19}
|
---|
432 | ,{-28,-57,-77,-75}
|
---|
433 | ,{-66,-55,-51,-68}
|
---|
434 | },{
|
---|
435 | {31,76,9,0,0,-35,-4643}
|
---|
436 | ,{-55,-77,-69,-55,-44,-43,-12336}
|
---|
437 | ,{-56,-85,-128,99,111,-116,-28030}
|
---|
438 | ,{105,107,101,101,106,111,31615}
|
---|
439 | },{-102,-88,-94,-113,-126,101,73,70}
|
---|
440 | /*fin_reglage*/
|
---|
441 |
|
---|
442 | },{
|
---|
443 |
|
---|
444 | /*debut reglage 5 */
|
---|
445 | {31,76,9,0},
|
---|
446 | {0
|
---|
447 | ,-14
|
---|
448 | ,-31
|
---|
449 | ,-63
|
---|
450 | ,-83
|
---|
451 | ,-103
|
---|
452 | ,-122
|
---|
453 | ,127
|
---|
454 | ,1
|
---|
455 | ,97
|
---|
456 | ,14
|
---|
457 | ,-80
|
---|
458 | ,-93
|
---|
459 | ,-87
|
---|
460 | ,-72
|
---|
461 | ,-80
|
---|
462 | ,-101
|
---|
463 | ,-112
|
---|
464 | ,-113
|
---|
465 | ,-121
|
---|
466 | },{
|
---|
467 | {22,100663296}
|
---|
468 | ,{1040629782,204800}
|
---|
469 | ,{1040834582,221184}
|
---|
470 | ,{22,0}
|
---|
471 | ,{-100450282,2}
|
---|
472 | ,{22,253952}
|
---|
473 | ,{-100458474,2}
|
---|
474 | ,{22,0}
|
---|
475 | ,{-100442090,2}
|
---|
476 | ,{-100253674,253954}
|
---|
477 | ,{22,0}
|
---|
478 | ,{303013910,221184}
|
---|
479 | ,{20,0}
|
---|
480 | ,{20,0}
|
---|
481 | ,{9238,0}
|
---|
482 | ,{24598,301989888}
|
---|
483 | ,{22,0}
|
---|
484 | ,{24598,0}
|
---|
485 | ,{0,0}
|
---|
486 | ,{0,0}
|
---|
487 | ,{0,0}
|
---|
488 | ,{0,0}
|
---|
489 | ,{0,0}
|
---|
490 | ,{0,0}
|
---|
491 | },{
|
---|
492 | {-15,-9,-13,-38}
|
---|
493 | ,{-83,-109,-90,-68}
|
---|
494 | ,{-99,-101,-67,-61}
|
---|
495 | ,{-64,-60,-38,-19}
|
---|
496 | ,{-28,-57,-77,-75}
|
---|
497 | ,{-66,-55,-51,-68}
|
---|
498 | },{
|
---|
499 | {31,76,9,0,0,-35,-4643}
|
---|
500 | ,{-55,-77,-69,-55,-44,-43,-12336}
|
---|
501 | ,{-56,-85,-128,99,111,-116,-28030}
|
---|
502 | ,{105,107,101,101,106,111,31615}
|
---|
503 | },{-102,-88,-94,-113,-126,101,73,70}
|
---|
504 | /*fin_reglage*/
|
---|
505 |
|
---|
506 | },{
|
---|
507 |
|
---|
508 | /*debut reglage 6 */
|
---|
509 | /*fin_reglage*/
|
---|
510 |
|
---|
511 | },{
|
---|
512 |
|
---|
513 | /*debut reglage 7 */
|
---|
514 | /*fin_reglage*/
|
---|
515 |
|
---|
516 | } };
|
---|
517 |
|
---|
518 | /* ------------------------------------ corps des fonctions ------------------------------ */
|
---|
519 | /* -------------------------------------------------------------------------------------------- */
|
---|
520 |
|
---|
521 |
|
---|
522 |
|
---|
523 | unsigned long val_long(char x)
|
---|
524 | {
|
---|
525 | unsigned long a,xl;
|
---|
526 | a=x-2; if(x<3) xl=x; else xl=((a&1) + 2)<<(a>>1);
|
---|
527 | return(xl);
|
---|
528 | }
|
---|
529 |
|
---|
530 |
|
---|
531 | double val_double(char x)
|
---|
532 | {
|
---|
533 | unsigned long a,xl;
|
---|
534 | if(x<0) x=-x; a=x; if(!a) xl=0; else xl=((a&1) + 2)<<(a>>1);
|
---|
535 | if(x>0) return(1e-4*(double)xl); else return(-1e-4*(double)xl);
|
---|
536 | }
|
---|
537 |
|
---|
538 | int new_val_dac(int a,char code)
|
---|
539 | {
|
---|
540 | if(code&0x80) a=(code&0x7f) <<5 ;
|
---|
541 | else {
|
---|
542 | if(code&0x40) a+=code&0x3f;
|
---|
543 | else a-=code&0x3f;
|
---|
544 | }
|
---|
545 | return(a);
|
---|
546 | }
|
---|
547 |
|
---|
548 |
|
---|
549 |
|
---|
550 |
|
---|
551 | int calcul_somme_block(block_type_modele* blk,int longueur)
|
---|
552 | {
|
---|
553 | int i,so=0;;
|
---|
554 | for(i=0;i<(longueur/4-4);i++) so^=(int)blk->mot[i];
|
---|
555 | /* somme sur tous les mots internes : on exclus le dbut, les codes et la fin */
|
---|
556 | return((so^(so>>16))&0xffff);
|
---|
557 | }
|
---|
558 |
|
---|
559 |
|
---|
560 |
|
---|
561 |
|
---|
562 | void valide_block(block_type_modele* blk,int type,int block_num)
|
---|
563 | {
|
---|
564 | int somme,longueur;
|
---|
565 | def_long_block
|
---|
566 | longueur=long_block[type];
|
---|
567 | /*printf("valide block adresse %x type %d numblock %d longueur=%d \n" */
|
---|
568 | /* ,(unsigned)blk,type,block_num,longueur);*/
|
---|
569 | blk->debut = debut_block_mesure;
|
---|
570 | blk->code2 = (((long)block_num) & 0xffffff ) | ( (((long)type)<<24)&0xff000000 );
|
---|
571 |
|
---|
572 | blk->mot[longueur/4-4] = fin_block_mesure;
|
---|
573 | somme=calcul_somme_block(blk,longueur);
|
---|
574 | blk->code1 = (((long)longueur)<<16) | somme;
|
---|
575 | }
|
---|
576 |
|
---|
577 |
|
---|
578 |
|
---|
579 |
|
---|
580 | int verifie_block(block_type_modele* blk)
|
---|
581 | {
|
---|
582 | int type,lg,som;
|
---|
583 | def_long_block
|
---|
584 | if(blk->debut != debut_block_mesure) return(block_debut_erreur);
|
---|
585 | type=type_block(blk); if( (type<0) ||(type>=nb_type_blocks) ) return(block_type_inconnu);
|
---|
586 | lg=longueur_block(blk); if( lg != long_block[type] ) return(block_longueur_erreur);
|
---|
587 | if( blk->mot[(lg/4)-4] != fin_block_mesure) return(block_fin_erreur);
|
---|
588 | som=calcul_somme_block(blk,lg); if( som!= somme_block(blk)) return(block_somme_erreur);
|
---|
589 | return(block_correct);
|
---|
590 | }
|
---|
591 |
|
---|
592 |
|
---|
593 | int verifie_block_printf(block_type_modele* blk)
|
---|
594 | {
|
---|
595 | int type,lg,som;
|
---|
596 | def_long_block
|
---|
597 | def_nom_block
|
---|
598 | if(blk->debut != debut_block_mesure)
|
---|
599 | {
|
---|
600 | printf(" erreur dans le code debut de block \n");
|
---|
601 | return(block_debut_erreur);
|
---|
602 | }
|
---|
603 |
|
---|
604 | type=type_block(blk);
|
---|
605 | if( (type<0) || (type>nb_type_blocks) )
|
---|
606 | {
|
---|
607 | printf(" block de type %d inconnu\n",type);
|
---|
608 | return(block_type_inconnu);
|
---|
609 | }
|
---|
610 |
|
---|
611 | lg=longueur_block(blk);
|
---|
612 | if( lg!=long_block[type] )
|
---|
613 | {
|
---|
614 | printf(" block type %s erreur de longueur (nominal=%d , dans le block=%d \n"
|
---|
615 | ,nom_block[type],long_block[type],lg);
|
---|
616 | return(block_longueur_erreur);
|
---|
617 | }
|
---|
618 |
|
---|
619 | som=calcul_somme_block(blk,lg);
|
---|
620 | if( som!=somme_block(blk) )
|
---|
621 | {
|
---|
622 | printf(" block type %s : erreur de somme (calculee=%d , dans le block=%d \n"
|
---|
623 | ,nom_block[type],som,somme_block(blk) );
|
---|
624 | return(block_somme_erreur);
|
---|
625 | }
|
---|
626 |
|
---|
627 | if(blk->mot[(lg/4)-4] != fin_block_mesure)
|
---|
628 | {
|
---|
629 | printf(" block type %s erreur de code fin de block : trouve %x au lieu de %x \n"
|
---|
630 | ,nom_block[type],(int)blk->mot[(lg/4)-4],fin_block_mesure);
|
---|
631 | return(block_fin_erreur);
|
---|
632 | }
|
---|
633 |
|
---|
634 | return(block_correct);
|
---|
635 | }
|
---|
636 |
|
---|
637 |
|
---|
638 |
|
---|
639 |
|
---|
640 |
|
---|
641 |
|
---|
642 |
|
---|