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