source: Sophya/trunk/AddOn/TAcq/veriftag.cc

Last change on this file was 3561, checked in by cmv, 17 years ago

uint_8 0x100000000 -> uint_8 0x100000000ULL mais ajout seulement d'une ligne commentee cmv 22/01/2009

File size: 1.4 KB
Line 
1FILE * is1 = fopen(args[0].c_str(),"r");
2FILE * is2 = fopen(args[1].c_str(),"r");
3if(is1==NULL || is2==NULL) {
4 cout<<"mauvais fichiers: 1="<<is1<<" 2="<<is2<<endl;
5 if(is1) fclose(is1);
6 if(is2) fclose(is2);
7}
8
9char line1[2048], line2[2048];
10uint_8 tt,fc,dtt,dfc;
11uint_8 tt01, fc01, tt02,fc02;
12
13DataTable dt;
14dt.AddLongColumn("tt1");
15dt.AddLongColumn("fc1");
16dt.AddLongColumn("dtt1");
17dt.AddLongColumn("dfc1");
18dt.AddLongColumn("frl1");
19dt.AddLongColumn("tt2");
20dt.AddLongColumn("fc2");
21dt.AddLongColumn("dtt2");
22dt.AddLongColumn("dfc2");
23dt.AddLongColumn("frl2");
24DataTableRow dtr = dt.EmptyRow();
25
26int_4 n = 0;
27while(fgets(line1,2040,is1)!=NULL && fgets(line2,2040,is2)!=NULL) {
28 uint_4 a,b,c,d;
29 sscanf(line1,"%x %x %x %x",&a,&b,&c,&d);
30 tt = a*0x100000000 + b;
31 //tt = a*0x100000000ULL + b;
32 fc = c;
33 if(n==0) {
34 dtt = dfc = 0;
35 } else {
36 dtt = tt-tt01;
37 dfc = fc - fc01;
38 }
39 dtr[0] = tt; dtr[1] = fc; dtr[2]=dtt; dtr[3]=dfc; dtr[4]=d;
40 tt01 = tt;
41 fc01 = fc;
42
43 sscanf(line2,"%x %x %x %x",&a,&b,&c,&d);
44 tt = a*0x100000000 + b;
45 //tt = a*0x100000000ULL + b;
46 fc = c;
47 if(n==0) {
48 dtt = dfc = 0;
49 } else {
50 dtt = tt-tt02;
51 dfc = fc - fc02;
52 }
53 dtr[5] = tt; dtr[6] = fc; dtr[7]=dtt; dtr[8]=dfc; dtr[9]=d;
54 tt02 = tt;
55 fc02 = fc;
56
57 dt.AddRow(dtr);
58 n++;
59
60 }
61fclose(is1);
62fclose(is2);
63cout<<dt;
64//KeepObj(dt);
65POutPersist po("xdtt.ppf");
66po<<dt;
67cout<<"fin du job"<<endl;
Note: See TracBrowser for help on using the repository browser.