1 #include "ColorFilterMode.h"
4 #include "MainWindow.h"
5 #include <QApplication>
9 const QString CMD_DEBUG (
"debug");
10 const QString CMD_ERROR (
"error");
11 const QString CMD_GNUPLOT (
"gnuplot");
12 const QString CMD_HELP (
"help");
13 const QString DASH_DEBUG (
"-" + CMD_DEBUG);
14 const QString DASH_ERROR (
"-" + CMD_ERROR);
15 const QString DASH_GNUPLOT (
"-" + CMD_GNUPLOT);
16 const QString DASH_HELP (
"-" + CMD_HELP);
19 void parseCmdLine (
int argc,
char **argv,
bool &isDebug, QString &errorReportFile,
bool &isGnuplot);
22 int main(
int argc,
char *argv[])
24 qRegisterMetaType<ColorFilterMode> (
"ColorFilterMode");
26 QApplication a(argc, argv);
28 bool isDebug, isGnuplot;
29 QString errorReportFile;
36 initializeLogging (
"engauge",
47 void parseCmdLine (
int argc,
50 QString &errorReportFile,
53 const int COLUMN_WIDTH = 20;
54 bool showUsage =
false;
57 bool nextIsErrorReportFile =
false;
64 for (
int i = 1; i < argc; i++) {
66 if (nextIsErrorReportFile) {
67 errorReportFile = argv [i];
68 nextIsErrorReportFile =
false;
69 }
else if (strcmp (argv [i], DASH_DEBUG.toLatin1().data()) == 0) {
71 }
else if (strcmp (argv [i], DASH_ERROR.toLatin1().data()) == 0) {
72 nextIsErrorReportFile =
true;
73 }
else if (strcmp (argv [i], DASH_GNUPLOT.toLatin1().data()) == 0) {
80 if (showUsage || nextIsErrorReportFile) {
82 cerr <<
"Usage: engauge "
83 <<
"[" << DASH_DEBUG.toLatin1().data() <<
"] "
84 <<
"[" << DASH_ERROR.toLatin1().data() <<
" <file>] "
85 <<
"[" << DASH_GNUPLOT.toLatin1().data() <<
"]" << endl
86 <<
" " << DASH_DEBUG.leftJustified(COLUMN_WIDTH,
' ').toLatin1().data() <<
"Enables extra debug information" << endl
87 <<
" " << DASH_ERROR.leftJustified(COLUMN_WIDTH,
' ').toLatin1().data() <<
"Specifies an error report fie as input" << endl
88 <<
" " << DASH_GNUPLOT.leftJustified(COLUMN_WIDTH,
' ').toLatin1().data() <<
"Output diagnostic gnuplot input files for debugging" << endl;
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...