-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrlog.cpp
72 lines (51 loc) · 1.36 KB
/
grlog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// grlog.cpp
#include "stdafx.h"
#define GRLOGDIR "plots"
#define DATABASEDIR "database"
// global data structure
CWaferDataBase waferData;
int ReadLogFile(const std::string &filename)
{
CLogFile p;
// === Read log file =======================================================
printf("Open File: %s\n", gName.GetName_Log().c_str());
try
{
p.Open(filename.c_str());
p.Read(waferData);
}
catch (CLogError &e)
{
printf("ERROR reading log file: %s\n", e.ErrorMsg());
return 1;
}
// === Process log file ====================================================
try
{
waferData.Calculate();
}
catch (...)
{
printf("Error processing database!\n");
return 2;
}
return 0;
}
int main(int argc, char* argv[])
{
printf("grlog (" VERSIONSTRING ")\n");
// === Retrieve log file name ==============================================
if (!gName.Process(argc, argv)) return 1;
// _mkdir(gName.GetPath().c_str());
// === read logfile -> waferData ===========================================
int res = ReadLogFile(gName.GetName_Log());
if (res) return res;
// === Start GUI ===========================================================
TRint *theApp = new TRint("grlog", 0, NULL, /* &argc, argv, */ NULL, 0);
GrLogMainFrame *gui
= new GrLogMainFrame(waferData, gClient->GetRoot(),250,200);
gui->Update();
theApp->Run();
delete gui;
return 0;
}