Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

HistoDisplayMain.cc

Go to the documentation of this file.
00001 // HistoDisplayMain.C
00002 //  Main program for GUI of CDF Histogram Display.
00003 //
00004 //  1999 07 16 
00005 //  Tetsuo Arisawa, Kouji Ikado, Kuni Kondo (Waseda Univ.)
00006 //  Hans Wenzel (Karlsruhe)
00007 //  Kaori Maeshima (Fermilab)
00008 
00009 #include <iostream>
00010 #include <fstream>
00011 #include <stdio.h>
00012 #include <stdlib.h>
00013 
00014 #include "unistd.h"
00015 
00016 #include "TROOT.h"
00017 #include "TApplication.h" 
00018 #include "TGClient.h"
00019 
00020 #include "HistoDisplay.h"
00021 
00022 using std::cout;
00023 using std::endl;
00024 
00025 
00026 extern void InitGui(); 
00027 VoidFuncPtr_t initfuncs[] = { InitGui, 0 };
00028 
00029 TROOT root("GUI", "GUI test environement", initfuncs);
00030 
00031 
00032 int main(int margc, char **margv) 
00033 { 
00034   //   TROOT root("GUI", "GUI test environement", initfuncs);
00035 
00036   int argc=1;
00037 
00038   //  char **argv;
00039   //  argv[1]="HistoDisplayMain";
00040 
00041   char *argv[2];
00042   argv[0]=new char[20];
00043   argv[1]=new char[20];
00044   sprintf(argv[1],"HistoDisplayMain");
00045 
00046   //  cout << argc << endl;
00047   // cout << **argv << endl;
00048 
00049   const char *socketserver="localhost";
00050   std::string ss;
00051   Int_t port=9091;
00052   int copt;
00053 
00054   
00055   while ((copt=getopt(margc,margv,"s:p:h")) != EOF) {
00056 
00057     switch (copt) {
00058 
00059  
00060     case 'h':
00061       
00062       printf(" usage: %s\n", margv[0]);
00063       printf(" -s: IP address of OM socket server to connect to\n");
00064       printf("      default = localhost\n");
00065       printf(" -p: socket server port\n");
00066       printf("      default = 9091:");           
00067       printf("\n -h: print this message\n");
00068 
00069 
00070       exit(1);
00071       break;
00072 
00073 
00074     case 's':
00075 
00076       socketserver=optarg;      
00077       break;
00078       
00079     case 'p':
00080       
00081       port=atoi(optarg);
00082         break;
00083       
00084     default:
00085       
00086       socketserver="localhost";
00087       port=9091;
00088       
00089       
00090       printf("Using default socket server parameters - localhost:9091\n");
00091       
00092       break;
00093       
00094     }
00095   }
00096   
00097   
00098   cout << "ss=" << socketserver << " port=" << port << endl;
00099 
00100     TApplication theApp("App", &argc, argv);
00101 
00102 
00103     HistoDisplay Displays(gClient->GetRoot(), 200, 400, socketserver, port);
00104 
00105     theApp.Run();
00106 
00107     return 0;
00108 
00109 }
00110 

Generated on Mon Feb 15 11:06:47 2010 for loon by  doxygen 1.3.9.1