artdaq_mfextensions  v1_03_03a
msgviewer.cc
1 #include <QtWidgets/qdesktopwidget.h>
2 #include <stdio.h>
3 #include <QtWidgets/QApplication>
4 #include <iostream>
5 
6 #include "mfextensions/Binaries/mvdlg.hh"
7 
8 void print_usage() {
9  std::cout << "usage: msgviewer [options]\n"
10  << "allowed options:\n"
11  << " -h [ --help ] display this help message\n"
12  << " -c [ --configuration ] arg specify the configuration file to msgviewer\n";
13 }
14 
15 int main(int argc, char** argv) {
16  QApplication app(argc, argv);
17 
18  std::string conf = std::string();
19 
20  if (argc > 1) {
21  for (int i = 1; i < argc; ++i) {
22  if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
23  print_usage();
24  return 0;
25  }
26 
27  else if ((!strcmp(argv[i], "-c") || !strcmp(argv[i], "--configuration")) && i < argc - 1) {
28  conf = std::string(argv[i + 1]);
29  ++i;
30  }
31 
32  else {
33  std::cout << "unknown option: " << argv[i] << "\n";
34  print_usage();
35  return -1;
36  }
37  }
38  }
39 
40  msgViewerDlg dialog(conf);
41  dialog.setWindowFlags(Qt::Window);
42  dialog.show();
43 
44  return app.exec();
45 
46  return 0;
47 }
Message Viewer Dialog Window
Definition: mvdlg.hh:27