FACT++  1.0
int main ( int  argc,
char **  argv 
)

Definition at line 84 of file telesto.cc.

References gLog, TPointGui::SetExitLoopOnClose(), StartUpMessage(), and Usage().

85 {
86  if (!MARS::CheckRootVer())
87  return 0xff;
88 
89  MLog::RedirectErrorHandler(MLog::kColor);
90 
91  //
92  // Evaluate arguments
93  //
94  MArgs arg(argc, argv);
95  gLog.Setup(arg);
96 
98 
99  if (arg.HasOnly("-V") || arg.HasOnly("--version"))
100  return 0;
101 
102  if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
103  {
104  Usage();
105  return 2;
106  }
107 
108  const Bool_t kDebugMem = arg.HasOnlyAndRemove("--debug-mem");
109 
110  //
111  // check for the right usage of the program (number of arguments)
112  //
113  if (arg.GetNumArguments()>2)
114  {
115  gLog << warn << "WARNING - Wrong number of arguments..." << endl;
116  Usage();
117  return 2;
118  }
119 
120  TString fname=arg.GetArgumentStr(0);
121  TString mod =arg.GetArgumentStr(1);
122 
123  //
124  // check for the right usage of the program (number of options)
125  //
126  if (arg.GetNumOptions()>0)
127  {
128  gLog << warn << "WARNING - Unknown commandline options..." << endl;
129  arg.Print("options");
130  gLog << endl;
131  return 2;
132  }
133 
134 // MArray::Class()->IgnoreTObjectStreamer();
135 // MParContainer::Class()->IgnoreTObjectStreamer();
136 
137  TApplication app("telesto", &argc, argv);
138  if (!gClient || gROOT->IsBatch())
139  {
140  gLog << err << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;
141  return 1;
142  }
143 
144  if (kDebugMem)
145  TObject::SetObjectStat(kTRUE);
146 
147  TPointGui *gui = new TPointGui(fname, mod);
148  gui->SetExitLoopOnClose();
149 
150  // Wait until the user decides to exit the application
151  app.Run(kFALSE);
152 
153  if (TObject::GetObjectStat())
154  {
155  TObject::SetObjectStat(kFALSE);
156  gObjectTable->Print();
157  }
158 
159  return 0;
160 }
#define gLog
Definition: fits.h:36
static void Usage()
Definition: telesto.cc:41
static void StartUpMessage()
Definition: telesto.cc:27
void SetExitLoopOnClose(Bool_t b=kTRUE)
Definition: TPointGui.h:95

+ Here is the call graph for this function: