source: tags/Mars-V0.9.2/mars.cc@ 19999

Last change on this file since 19999 was 7001, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 3.1 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#if ROOT_VERSION_CODE < ROOT_VERSION(3,10,02)
20#include <TRootGuiFactory.h>
21#include <TPluginManager.h>
22void InitGuiFactory()
23{
24 if (gROOT->IsBatch())
25 gROOT->SetBatch(kFALSE);
26
27 //
28 // Must be loaded by hand, because it is not loaded by TGApplication.
29 // We could also use TApplication instead, but TApplication doesn't
30 // deal with the DISPLAY variable in a convient way.
31 //
32 TPluginHandler *h;
33 if ((h = gROOT->GetPluginManager()->FindHandler("TGuiFactory", "root")))
34 {
35 if (h->LoadPlugin() == -1)
36 return;
37 gGuiFactory = (TGuiFactory*)h->ExecPlugin(0);
38 }
39}
40#endif
41*/
42
43// **********************************************************************
44//
45// MARS main program
46//
47// The only job of the main program is the initialisation of ROOT and
48// the start of the guiinterface for the mars program
49//
50// started by h. kornmayer january, 3rd 2001
51static void StartUpMessage()
52{
53 gLog << all << endl;
54
55 // 1 2 3 4 5
56 // 12345678901234567890123456789012345678901234567890
57 gLog << "==================================================" << endl;
58 gLog << " MARS V" << MARSVER << endl;
59 gLog << " Magic Analysis and Reconstruction Software" << endl;
60 gLog << " Compiled on <" << __DATE__ << ">" << endl;
61 gLog << " Using ROOT v" << ROOTVER << endl;
62 gLog << "==================================================" << endl;
63 gLog << endl;
64}
65
66static void Usage()
67{
68 gLog << all << endl;
69 gLog << "Sorry the usage is:" << endl;
70 gLog << " mars [-h] [-?] [-a0] [-vn]" << endl << endl;
71 gLog.Usage();
72 gLog << " -?/-h: This help" << endl << endl;
73}
74
75int main(int argc, char **argv)
76{
77 //
78 // Evaluate arguments
79 //
80 MArgs arg(argc, argv, kTRUE);
81 gLog.Setup(arg);
82
83 StartUpMessage();
84
85 if (arg.HasOption("-?") || arg.HasOption("-h"))
86 {
87 Usage();
88 return 2;
89 }
90
91#ifdef HAVE_XPM
92 MLogo logo;
93 logo.Popup();
94#endif
95
96 //
97 // initialise ROOT
98 //
99 TApplication app("mars", &argc, argv);
100 if (gROOT->IsBatch() || !gClient)
101 {
102 gLog << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;
103 return 1;
104 }
105
106 //
107 // Swtich of TObjectStreamer in our base classes derived from TObject
108 //
109 MArray::Class()->IgnoreTObjectStreamer();
110 MParContainer::Class()->IgnoreTObjectStreamer();
111
112 /*
113 TGApplication app("Mars", &argc, argv);
114
115#if ROOT_VERSION_CODE < ROOT_VERSION(3,10,02)
116 InitGuiFactory();
117#endif
118 */
119
120#ifdef HAVE_XPM
121 logo.Popdown();
122#endif
123
124 //
125 // start the main window
126 //
127 new MCameraDisplay;
128
129 //
130 // run the application
131 //
132 app.Run();
133
134 gLog << all << endl;
135
136 return 0;
137}
138
139
Note: See TracBrowser for help on using the repository browser.