10 #include "TApplication.h"
12 #include "TRootEmbeddedCanvas.h"
13 #include "TGStatusBar.h"
16 #include "TGTextEntry.h"
19 #include "TGFileDialog.h"
24 #include "TObjArray.h"
25 #include "TObjString.h"
51 int main(
int argc,
char **argv)
54 std::string server_name =
"localhost";
55 int server_port = 9090;
56 std::string root_file_name =
"";
57 std::string module_file_name =
"";
59 while ((c = getopt(argc, argv,
"hH:p:i:M:")) != -1)
70 server_port = atoi(optarg);
73 root_file_name = optarg;
76 module_file_name = optarg;
84 char fake_arg_str[256];
85 sprintf(fake_arg_str,
"./online-display");
86 char *fake_argv[] = {fake_arg_str};
88 TApplication theApp(
"RMidas", &fake_argc, fake_argv);
90 if (
gROOT->IsBatch()) {
91 printf(
"%s: cannot run in batch mode\n", argv[0]);
95 std::cout<<module_file_name<<std::endl;
98 if (root_file_name.length() != 0)
105 onlineFrame->Print();
109 std::vector<TString> vHistTitles = onlineFrame->
GetHistTitles();
110 for (
unsigned int i = 0;
i < vHistTitles.size(); ++
i)
113 TH1 *hist = onlineFrame->
GetHist(vHistTitles.at(
i).Data());
117 hist->Clone(vHistTitles.at(
i).Data());
135 time_t lastCycleTime = 0;
144 lastCycleTime =
time(NULL);
158 printf(
"Default connection is to localhost:9090.\n");
159 printf(
"To specify another host, use: \n");
160 printf(
"\t ./online-display -H hostname -p port\n");
161 printf(
"Or, to open a ROOT file:\n");
162 printf(
"\t ./online-display -i filename\n");