source: tags/Mars-V0.9.3/mars.cc@ 11744

Last change on this file since 11744 was 7091, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 2.4 KB
Line 
1#include <TApplication.h>
2
3#include "MAGIC.h"
4
5#include "MLog.h"
6#include "MLogManip.h"
7
8#include "MCameraDisplay.h"
9#include "MArgs.h"
10#include "MArray.h"
11#include "MParContainer.h"
12
13#ifdef HAVE_XPM
14#include "MLogo.h"
15#endif
16
17using namespace std;
18
19// **********************************************************************
20//
21// MARS main program
22//
23// The only job of the main program is the initialisation of ROOT and
24// the start of the guiinterface for the mars program
25//
26// started by h. kornmayer january, 3rd 2001
27static void StartUpMessage()
28{
29 gLog << all << endl;
30
31 // 1 2 3 4 5
32 // 12345678901234567890123456789012345678901234567890
33 gLog << "==================================================" << endl;
34 gLog << " MARS V" << MARSVER << endl;
35 gLog << " Magic Analysis and Reconstruction Software" << endl;
36 gLog << " Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ ">" << endl;
37 gLog << "==================================================" << endl;
38 gLog << endl;
39}
40
41static void Usage()
42{
43 gLog << all << endl;
44 gLog << "Sorry the usage is:" << endl;
45 gLog << " mars [options]" << endl << endl;
46 gLog << " Options:" << endl;
47 gLog.Usage();
48 gLog << " -?/-h: This help" << endl << endl;
49}
50
51int main(int argc, char **argv)
52{
53 //
54 // Evaluate arguments
55 //
56 MArgs arg(argc, argv, kTRUE);
57 gLog.Setup(arg);
58
59 StartUpMessage();
60
61 if (arg.HasOption("-?") || arg.HasOption("-h"))
62 {
63 Usage();
64 return 2;
65 }
66
67#ifdef HAVE_XPM
68 MLogo logo;
69 logo.Popup();
70#endif
71
72 //
73 // initialise ROOT
74 //
75 TApplication app("mars", &argc, argv);
76 if (gROOT->IsBatch() || !gClient)
77 {
78 gLog << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;
79 return 1;
80 }
81
82 //
83 // Swtich of TObjectStreamer in our base classes derived from TObject
84 //
85 MArray::Class()->IgnoreTObjectStreamer();
86 MParContainer::Class()->IgnoreTObjectStreamer();
87
88 /*
89 TGApplication app("Mars", &argc, argv);
90
91#if ROOT_VERSION_CODE < ROOT_VERSION(3,10,02)
92 InitGuiFactory();
93#endif
94 */
95
96#ifdef HAVE_XPM
97 logo.Popdown();
98#endif
99
100 //
101 // start the main window
102 //
103 new MCameraDisplay;
104
105 //
106 // run the application
107 //
108 app.Run();
109
110 gLog << all << endl;
111
112 return 0;
113}
114
115
Note: See TracBrowser for help on using the repository browser.