Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
341 | f9daq | 1 | /* Program l2d.c za testiranje povrsinske obcutljivosti |
2 | |||
3 | Avtor: Samo Korpar |
||
4 | Verzija: |
||
5 | 1.00 3.5.2007 |
||
6 | - |
||
7 | */ |
||
8 | |||
9 | //#define USE_DAQ |
||
10 | //#define USE_MIKRO |
||
11 | |||
12 | // Izberi ustrezni interface v meniju projektnega okna |
||
13 | // Options->CompilerDefines (dodaj /DSISVME ali /DWIENVME) |
||
14 | #ifdef USE_DAQ |
||
15 | # define USE_CAMAC |
||
16 | # include "camac.h" |
||
17 | # ifdef SISVME |
||
18 | # include "sisvme_dll.h" |
||
19 | # endif |
||
20 | # ifdef WIENVME |
||
21 | # include "wienvme_dll.h" |
||
22 | # endif |
||
23 | # include "CAENV965.h" |
||
24 | #endif |
||
25 | |||
26 | #ifdef USE_MIKRO |
||
27 | # include "MIKRO.h" |
||
28 | #endif |
||
29 | |||
30 | #include <userint.h> |
||
31 | #include <ansi_c.h> |
||
32 | #include <utility.h> |
||
33 | #include <analysis.h> |
||
34 | |||
35 | #include "l2d_ui.h" |
||
36 | |||
37 | #ifdef USE_DAQ |
||
38 | //# define VTDC_ADDR 0x330000 |
||
39 | # define VADC_ADDR 0x340000 |
||
40 | //# define VTDC 0 |
||
41 | # define VADC 1 |
||
42 | //# define IO1_ADDR 0x100200 |
||
43 | //# define NTDCP 20 |
||
44 | # define NTDCJ 18 |
||
45 | # define NGL 23 |
||
46 | #endif |
||
47 | |||
48 | #ifdef USE_MIKRO |
||
49 | # define MIKRO_COM 3 |
||
50 | #endif |
||
51 | |||
52 | #define MAXCH 0x1000 |
||
53 | #define MAX_THREADS 10 |
||
54 | |||
55 | #define IWAIT 200 |
||
56 | |||
57 | # define NCH 8 |
||
58 | static int p1h, pID, rID, tfID; |
||
59 | static int ph_tdc, ph_adc; |
||
60 | static int dtdc[NCH][2][MAXCH]; |
||
61 | static int dadc[NCH][2][MAXCH]; |
||
62 | static int daq_on; |
||
63 | static int poolHandle = 0; |
||
64 | static int ntics,dummy; |
||
65 | // 0 1 2 3 4 5 6 7 8 9 A B C D E F |
||
66 | static int tdcmap[16]={ 0, 1, 2, 3, 4, 5, 6, 7,99,99,99,99,99,99,99,99}; |
||
67 | static int adcmap[16]={99,99,99,99,99,99,99,99, 0, 1, 2, 3, 4, 5, 6, 7}; |
||
68 | static int ctdcmap[16]={ 0, 1, 2, 3, 4, 5, 6, 7,99,99,99,99,99,99,99,99}; |
||
69 | |||
70 | /************************************************************/ |
||
71 | void wait_loop(unsigned long iloop) |
||
72 | |||
73 | { |
||
74 | int i; |
||
75 | |||
76 | for (i=0;i<iloop;i++); |
||
77 | return; |
||
78 | } |
||
79 | |||
80 | int CVICALLBACK cb_timer (int panel, int control, int event, void *callbackData, |
||
81 | int eventData1, int eventData2) |
||
82 | { |
||
83 | QueueUserEvent (9000, p1h, P1_TIMER); |
||
84 | return (0); |
||
85 | } |
||
86 | |||
87 | int update_plots (void) |
||
88 | { |
||
89 | int irange, ch; |
||
90 | |||
91 | GetCtrlVal (p1h, P1_PLCH, &ch); |
||
92 | |||
93 | if (ph_tdc>0) DeleteGraphPlot (p1h, P1_TDC, ph_tdc, VAL_DELAYED_DRAW); |
||
94 | GetCtrlVal (p1h, P1_TDCHL, &irange); |
||
95 | ph_tdc = PlotY (p1h, P1_TDC, &dtdc[ch][irange], MAXCH, VAL_INTEGER, |
||
96 | VAL_VERTICAL_BAR, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_RED); |
||
97 | |||
98 | if (ph_adc>0) DeleteGraphPlot (p1h, P1_ADC, ph_adc, VAL_DELAYED_DRAW); |
||
99 | GetCtrlVal (p1h, P1_ADCHL, &irange); |
||
100 | ph_adc = PlotY (p1h, P1_ADC, &dadc[ch][irange], MAXCH, VAL_INTEGER, |
||
101 | VAL_VERTICAL_BAR, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_BLUE); |
||
102 | return (0); |
||
103 | } |
||
104 | |||
105 | int CVICALLBACK daq_run(void *functionData) |
||
106 | { |
||
107 | int i,j; |
||
108 | int ndat,dtype,ch,rg,adc,cres; |
||
109 | unsigned long a,b,ec1,ec2; |
||
110 | unsigned long data[100]; |
||
111 | unsigned short aa[NCH][4]; |
||
112 | |||
113 | int dsave,status,fmax,fcount,fev; |
||
114 | char dfile[MAX_PATHNAME_LEN],dfile0[MAX_PATHNAME_LEN]; |
||
115 | int supr0,tdcmin,fseed,esave; |
||
116 | float frac; |
||
117 | double fracg; |
||
118 | |||
119 | FILE *fp; |
||
120 | #define RUNREC_ID 1 |
||
121 | #define ENDREC_ID 2 |
||
122 | #define POSREC_ID 3 |
||
123 | #define EVTREC_ID 4 |
||
124 | |||
125 | typedef struct { |
||
126 | unsigned long id,len; |
||
127 | unsigned long fver,time; |
||
128 | unsigned long nev,nch,ped,xy; |
||
129 | long nx,x0,dx,ny,y0,dy; |
||
130 | } RUNREC; |
||
131 | RUNREC runrec; |
||
132 | |||
133 | typedef struct { |
||
134 | unsigned long id,len; |
||
135 | unsigned long time; |
||
136 | } ENDREC; |
||
137 | ENDREC endrec; |
||
138 | |||
139 | typedef struct { |
||
140 | unsigned long id,len; |
||
141 | unsigned long time; |
||
142 | long ix,x,xset,iy,y,yset; |
||
143 | } POSREC; |
||
144 | POSREC posrec; |
||
145 | |||
146 | typedef struct { |
||
147 | unsigned long id,len; |
||
148 | unsigned long nev; |
||
149 | unsigned short data[NCH*2]; |
||
150 | } EVTREC; |
||
151 | EVTREC evtrec; |
||
152 | |||
153 | runrec.id = RUNREC_ID; |
||
154 | runrec.len = sizeof(runrec); |
||
155 | runrec.fver = 0x10000; |
||
156 | runrec.nch = NCH; |
||
157 | runrec.xy = 1; |
||
158 | endrec.id = ENDREC_ID; |
||
159 | endrec.len = sizeof(endrec); |
||
160 | posrec.id = POSREC_ID; |
||
161 | posrec.len = sizeof(posrec); |
||
162 | evtrec.id = EVTREC_ID; |
||
163 | evtrec.len = sizeof(evtrec); |
||
164 | |||
165 | cres = 0; |
||
166 | |||
167 | GetCtrlVal (p1h, P1_NEVE, &runrec.nev); |
||
168 | GetCtrlVal (p1h, P1_PEDESTAL, &runrec.ped); |
||
169 | |||
170 | GetCtrlVal (p1h, P1_NX, &runrec.nx); |
||
171 | GetCtrlVal (p1h, P1_XSTEP, &runrec.dx); |
||
172 | GetCtrlVal (p1h, P1_XMIN, &runrec.x0); |
||
173 | GetCtrlVal (p1h, P1_NY, &runrec.ny); |
||
174 | GetCtrlVal (p1h, P1_YSTEP, &runrec.dy); |
||
175 | GetCtrlVal (p1h, P1_YMIN, &runrec.y0); |
||
176 | |||
177 | GetCtrlVal (p1h, P1_DSAVE, &dsave); |
||
178 | if (dsave) { |
||
179 | GetCtrlVal (p1h, P1_DFILE, dfile0); |
||
180 | |||
181 | fev=0; |
||
182 | fcount=1; |
||
183 | GetCtrlVal (p1h, P1_NEWF, &fmax); |
||
184 | } |
||
185 | GetCtrlVal (p1h, P1_SUPR, &supr0); |
||
186 | if (supr0) { |
||
187 | GetCtrlVal (p1h, P1_TDCMIN, &tdcmin); |
||
188 | GetCtrlVal (p1h, P1_FRAC, &frac); |
||
189 | } |
||
190 | |||
191 | #ifdef USE_DAQ |
||
192 | // V965_map (VTDC, VTDC_ADDR, 1); |
||
193 | // V965_init (VTDC, pedestal); |
||
194 | |||
195 | V965_map (VADC, VADC_ADDR, 1); |
||
196 | V965_init (VADC, runrec.ped); |
||
197 | |||
198 | # ifdef USE_CAMAC |
||
199 | BZ(&cres); |
||
200 | CCCZ(&cres); |
||
201 | CCCC(&cres); |
||
202 | CREM_I(&cres); |
||
203 | CSSA_R(NGL,0,25,&cres); |
||
204 | Delay(0.01); |
||
205 | # ifdef NTDCJ |
||
206 | CSSA_R(NTDCJ,0,9,&cres); |
||
207 | printf("CSSA_R(NTDCJ,0,9,&cres)=0x%0x\n", cres); |
||
208 | CSSA_R(NTDCJ,0,26,&cres); |
||
209 | printf("CSSA_R(NTDCJ,0,26,&cres)=0x%0x\n", cres); |
||
210 | # endif |
||
211 | # ifdef NTDCP |
||
212 | CSSA_R(NTDCP,0,9,&cres); |
||
213 | CSSA_R(NTDCP,0,11,&cres); |
||
214 | CSSA_R(NTDCP,0,26,&cres); |
||
215 | printf("CSSA_R(NTDCP,0,26,&cres)=0x%0x\n", cres); |
||
216 | # endif |
||
217 | # endif |
||
218 | #endif |
||
219 | |||
220 | if (dsave) { |
||
221 | sprintf(dfile,"%s_file%02d.dat",dfile0,fcount); |
||
222 | fp = fopen (dfile, "wb"); |
||
223 | time (&runrec.time); |
||
224 | status = fwrite (&runrec, 1, runrec.len, fp); |
||
225 | } |
||
226 | if (supr0) { |
||
227 | fseed = runrec.time & 0x7fffffff; |
||
228 | Uniform (1, fseed, &fracg); |
||
229 | } |
||
230 | |||
231 | for (posrec.ix=0;posrec.ix<runrec.nx;posrec.ix++) { |
||
232 | posrec.xset=runrec.x0+posrec.ix*runrec.dx; |
||
233 | #ifdef USE_MIKRO |
||
234 | // printf("MIKRO_MoveTo (1, x);%d\n",x); |
||
235 | MIKRO_MoveTo (1, posrec.xset); |
||
236 | // printf("->MIKRO_MoveTo (1, x);%d\n",x); |
||
237 | #endif |
||
238 | |||
239 | SetCtrlVal (p1h, P1_X, posrec.xset); |
||
240 | SetCtrlVal (p1h, P1_IX, posrec.ix); |
||
241 | for (posrec.iy=0;posrec.iy<runrec.ny;posrec.iy++) { |
||
242 | |||
243 | posrec.yset=runrec.y0+posrec.iy*runrec.dy; |
||
244 | #ifdef USE_MIKRO |
||
245 | // printf("MIKRO_MoveTo (2, y);%d\n",y); |
||
246 | MIKRO_MoveTo (2, posrec.yset); |
||
247 | // printf("->MIKRO_MoveTo (2, y);%d\n",y); |
||
248 | #endif |
||
249 | |||
250 | SetCtrlVal (p1h, P1_Y, posrec.yset); |
||
251 | SetCtrlVal (p1h, P1_IY, posrec.iy); |
||
252 | |||
253 | if (dsave) { |
||
254 | time (&posrec.time); |
||
255 | status = fwrite (&posrec, 1, posrec.len, fp); |
||
256 | } |
||
257 | |||
258 | // clear the plots |
||
259 | for (j=0;j<NCH;j++) { |
||
260 | for (i=0;i<MAXCH;i++){ |
||
261 | dtdc[j][0][i]=0; |
||
262 | dtdc[j][1][i]=0; |
||
263 | dadc[j][0][i]=0; |
||
264 | dadc[j][1][i]=0; |
||
265 | } |
||
266 | } |
||
267 | |||
268 | evtrec.nev=1; |
||
269 | do { |
||
270 | for (j=0;j<NCH;j++) |
||
271 | for (i=0;i<4;i++) |
||
272 | aa[j][i]=0; |
||
273 | // if((neve%1000)==0) printf("Events %ld\n",neve); |
||
274 | |||
275 | #ifdef USE_DAQ |
||
276 | ndat = 0; |
||
277 | // a = 0x0001; |
||
278 | // VME_A24D16_W(IO1_ADDR + 0x000008, &a); //poslje laserski sunek |
||
279 | |||
280 | ntics=0; |
||
281 | # ifdef USE_CAMAC |
||
282 | CSSA_R(NGL,0,10,&cres); |
||
283 | // do { |
||
284 | // wait_loop(IWAIT); |
||
285 | // Delay(0.1); |
||
286 | # ifdef NTDCJ |
||
287 | // CSSA_R(NTDCJ,0,8,&cres); |
||
288 | # endif |
||
289 | # ifdef NTDCP |
||
290 | // CSSA_R(NTDCP,0,8,&cres); |
||
291 | # endif |
||
292 | // if (!(cres&0x8000)) printf("CSSA_R(NTDCJ,0,8,&cres)=0x%0x\n", cres) ; |
||
293 | // } while ((!(cres&0x8000))&&(ntics<2)&&daq_on); |
||
294 | # endif |
||
295 | // wait_loop(2000); |
||
296 | while((!(V965_status(VADC)&0x1))&&(ntics<2)&&daq_on); |
||
297 | if (!daq_on) break; |
||
298 | if (ntics>=2) { |
||
299 | ndat=V965_read (VADC, &data[0]); |
||
300 | continue; |
||
301 | } |
||
302 | wait_loop(2000); |
||
303 | /* |
||
304 | ndat=V965_read (VTDC, &data[0]); |
||
305 | for (i=0; i<ndat; i++) { |
||
306 | dtype=(data[i]>>25)&0x3; |
||
307 | if (dtype==0) { |
||
308 | ch=tdcmap[(data[i]>>17)&0xf]; |
||
309 | if (ch<NCH) { |
||
310 | rg=(data[i]>>16)&0x1; |
||
311 | adc=data[i]&0xfff; |
||
312 | aa[ch][rg]=adc; |
||
313 | dtdc[ch][rg][adc]+=1; |
||
314 | } |
||
315 | } |
||
316 | } |
||
317 | */ |
||
318 | for (i=0; i<NCH; i++) { |
||
319 | wait_loop(IWAIT); |
||
320 | # ifdef USE_CAMAC |
||
321 | # ifdef NTDCJ |
||
322 | CSSA_R(NTDCJ,ctdcmap[i],0,&adc); |
||
323 | # endif |
||
324 | # ifdef NTDCP |
||
325 | CSSA_R(NTDCP,ctdcmap[i],0,&adc); |
||
326 | # endif |
||
327 | # endif |
||
328 | // printf("TDC=0x%04X\n",adc); |
||
329 | adc=adc&0xfff; |
||
330 | aa[i][0]=adc; |
||
331 | dtdc[i][0][adc]+=1; |
||
332 | } |
||
333 | |||
334 | ndat=V965_read (VADC, &data[0]); |
||
335 | for (i=0; i<ndat; i++) { |
||
336 | dtype=(data[i]>>25)&0x3; |
||
337 | if (dtype==0) { |
||
338 | ch=adcmap[(data[i]>>17)&0xf]; |
||
339 | if (ch<NCH) { |
||
340 | rg=(data[i]>>16)&0x1; |
||
341 | adc=data[i]&0xfff; |
||
342 | aa[ch][rg+2]=adc; |
||
343 | dadc[ch][rg][adc]+=1; |
||
344 | } |
||
345 | } |
||
346 | } |
||
347 | |||
348 | # ifdef USE_CAMAC |
||
349 | wait_loop(IWAIT); |
||
350 | # ifdef NTDCJ |
||
351 | CSSA_R(NTDCJ,0,9,&cres); |
||
352 | # endif |
||
353 | # ifdef NTDCP |
||
354 | CSSA_R(NTDCP,0,9,&cres); |
||
355 | CSSA_R(NTDCP,0,26,&cres); |
||
356 | // printf("2 CSSA_R(NTDCP,0,26,&cres)=0x%0x\n", cres); |
||
357 | # endif |
||
358 | // Delay(0.001); |
||
359 | // wait_loop(IWAIT); |
||
360 | // CSSA_R(NGL,0,10,&cres); |
||
361 | # endif |
||
362 | |||
363 | #else /* generate test data */ |
||
364 | if (!daq_on) break; |
||
365 | for (i=0;i<NCH;i++) { |
||
366 | adc=100+evtrec.nev%200; |
||
367 | dtdc[i][1][adc]+=1; |
||
368 | dadc[i][1][adc]+=1; |
||
369 | aa[i][0]=adc; |
||
370 | aa[i][2]=adc; |
||
371 | adc=200+evtrec.nev%400; |
||
372 | dtdc[i][0][adc]+=1; |
||
373 | dadc[i][0][adc]+=1; |
||
374 | aa[i][1]=adc; |
||
375 | aa[i][3]=adc; |
||
376 | } |
||
377 | #endif |
||
378 | esave=dsave; |
||
379 | if (supr0 && esave) { |
||
380 | Uniform (1, -1, &fracg); |
||
381 | if (fracg > frac) { |
||
382 | esave=0; |
||
383 | for (i=0;i<NCH;i++) { |
||
384 | if ((aa[i][0] >= tdcmin) && (aa[i][0] < 4000)) esave=1; |
||
385 | } |
||
386 | } |
||
387 | } |
||
388 | if (esave) { |
||
389 | // time (&evtrec.time); |
||
390 | for (i=0;i<NCH;i++) { |
||
391 | evtrec.data[i] = aa[i][0]; |
||
392 | evtrec.data[i+NCH] = aa[i][2]; |
||
393 | } |
||
394 | status = fwrite (&evtrec, 1, evtrec.len, fp); |
||
395 | } |
||
396 | |||
397 | if (!(evtrec.nev%1000)) SetCtrlVal (p1h, P1_CEVE, evtrec.nev); |
||
398 | } while (evtrec.nev++<runrec.nev); |
||
399 | if (!daq_on) break; |
||
400 | } |
||
401 | if (!daq_on) break; |
||
402 | } |
||
403 | |||
404 | if (dsave) { |
||
405 | time (&endrec.time); |
||
406 | status = fwrite (&endrec, 1, endrec.len, fp); |
||
407 | fclose(fp); |
||
408 | } |
||
409 | |||
410 | daq_on=0; |
||
411 | SetCtrlVal (p1h, P1_DAQ, daq_on); |
||
412 | SetCtrlVal (p1h, P1_CEVE, evtrec.nev); |
||
413 | |||
414 | return 0; |
||
415 | } |
||
416 | |||
417 | int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, |
||
418 | LPSTR lpszCmdLine, int nCmdShow) |
||
419 | { |
||
420 | int i,j,status,refon; |
||
421 | long int zpos; |
||
422 | char dfile[300]; |
||
423 | FILE *fp; |
||
424 | |||
425 | typedef struct { |
||
426 | unsigned long id,len; |
||
427 | unsigned long fver,time; |
||
428 | unsigned long nev,nch,ped,xy; |
||
429 | long nx,x0,dx,ny,y0,dy; |
||
430 | } RUNREC; |
||
431 | RUNREC runrec; |
||
432 | |||
433 | if (InitCVIRTE (hInstance, 0, 0) == 0) |
||
434 | return -1; /* out of memory */ |
||
435 | |||
436 | SetSleepPolicy(VAL_SLEEP_MORE); |
||
437 | CmtNewThreadPool (MAX_THREADS, &poolHandle); |
||
438 | |||
439 | SetStdioWindowOptions (1000, 0, 0); |
||
440 | SetStdioWindowSize (150, 600); |
||
441 | SetStdioWindowPosition (825, 20); |
||
442 | |||
443 | #ifdef USE_DAQ |
||
444 | VME_START(NULL); |
||
445 | #endif |
||
446 | |||
447 | #ifdef USE_MIKRO |
||
448 | MIKRO_Open (MIKRO_COM); |
||
449 | MIKRO_Init (1,0); |
||
450 | MIKRO_Init (2,0); |
||
451 | MIKRO_Init (3,0); |
||
452 | #endif |
||
453 | |||
454 | if ((p1h = LoadPanel (0, "l2d_ui.uir", P1)) < 0) return -1; |
||
455 | DisplayPanel (p1h); |
||
456 | SetCtrlAttribute (p1h, P1_PLCH, ATTR_MAX_VALUE, NCH-1); |
||
457 | |||
458 | QueueUserEvent (1000, p1h, P1_RESET); |
||
459 | |||
460 | do { |
||
461 | GetUserEvent (1, &pID, &rID); |
||
462 | switch (rID) { |
||
463 | case P1_TIMER: |
||
464 | ntics+=1; |
||
465 | GetCtrlVal (p1h, P1_REFON, &refon); |
||
466 | if (refon) update_plots(); |
||
467 | break; |
||
468 | case P1_REFRESH: |
||
469 | update_plots(); |
||
470 | break; |
||
471 | case P1_DAQ: |
||
472 | GetCtrlVal (p1h, P1_DAQ, &daq_on); |
||
473 | if (daq_on) { |
||
474 | CmtScheduleThreadPoolFunction (poolHandle, daq_run, (void *)&dummy, &tfID); |
||
475 | } else { |
||
476 | CmtWaitForThreadPoolFunctionCompletion (poolHandle, tfID, |
||
477 | OPT_TP_PROCESS_EVENTS_WHILE_WAITING); |
||
478 | CmtReleaseThreadPoolFunctionID (poolHandle, tfID); |
||
479 | } |
||
480 | break; |
||
481 | case P1_ZSET: |
||
482 | if (!daq_on) { |
||
483 | GetCtrlVal (p1h, P1_ZSET, &zpos); |
||
484 | #ifdef USE_MIKRO |
||
485 | MIKRO_MoveTo (3, zpos); |
||
486 | #endif |
||
487 | } |
||
488 | break; |
||
489 | case P1_REREAD: |
||
490 | if (!daq_on) { |
||
491 | status = FileSelectPopup ("", "*.dat", ".dat", |
||
492 | "Izberi datoteko s podatki", |
||
493 | VAL_LOAD_BUTTON, 0, 0, 1, 0, dfile); |
||
494 | if (status==1) { |
||
495 | fp = fopen (dfile, "rb"); |
||
496 | status = fread (&runrec, 1, sizeof(runrec), fp); |
||
497 | fclose(fp); |
||
498 | if (runrec.id==1) { |
||
499 | SetCtrlVal (p1h, P1_NX, runrec.nx); |
||
500 | SetCtrlVal (p1h, P1_XSTEP, runrec.dx); |
||
501 | SetCtrlVal (p1h, P1_XMIN, runrec.x0); |
||
502 | SetCtrlVal (p1h, P1_NY, runrec.ny); |
||
503 | SetCtrlVal (p1h, P1_YSTEP, runrec.dy); |
||
504 | SetCtrlVal (p1h, P1_YMIN, runrec.y0); |
||
505 | SetCtrlVal (p1h, P1_NEVE, runrec.nev); |
||
506 | } |
||
507 | } |
||
508 | } |
||
509 | break; |
||
510 | case P1_HO: |
||
511 | if (!daq_on) { |
||
512 | SetWaitCursor (1); |
||
513 | #ifdef USE_MIKRO |
||
514 | MIKRO_ReferenceMove (1); |
||
515 | MIKRO_ReferenceMove (2); |
||
516 | MIKRO_ReferenceMove (3); |
||
517 | #endif |
||
518 | SetWaitCursor (0); |
||
519 | } |
||
520 | break; |
||
521 | case P1_RESET: |
||
522 | for (j=0;j<NCH;j++) { |
||
523 | for (i=0;i<MAXCH;i++){ |
||
524 | dtdc[j][0][i]=0; |
||
525 | dtdc[j][1][i]=0; |
||
526 | dadc[j][0][i]=0; |
||
527 | dadc[j][1][i]=0; |
||
528 | } |
||
529 | } |
||
530 | update_plots(); |
||
531 | break; |
||
532 | case P1_TDCLOG: |
||
533 | GetCtrlVal (p1h, P1_TDCLOG, &status); |
||
534 | SetCtrlAttribute (p1h, P1_TDC, ATTR_YMAP_MODE, status); |
||
535 | update_plots(); |
||
536 | break; |
||
537 | case P1_ADCLOG: |
||
538 | GetCtrlVal (p1h, P1_ADCLOG, &status); |
||
539 | SetCtrlAttribute (p1h, P1_ADC, ATTR_YMAP_MODE, status); |
||
540 | update_plots(); |
||
541 | break; |
||
542 | } |
||
543 | |||
544 | } while ((rID != P1_EXIT)||daq_on); |
||
545 | |||
546 | CmtDiscardThreadPool (poolHandle); |
||
547 | DiscardPanel (p1h); |
||
548 | |||
549 | #ifdef USE_MIKRO |
||
550 | MIKRO_Close (); |
||
551 | #endif |
||
552 | |||
553 | #ifdef USE_DAQ |
||
554 | VME_STOP(); |
||
555 | #endif |
||
556 | return 0; |
||
557 | |||
558 | } |