-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
67 lines (48 loc) · 2.75 KB
/
main.cpp
File metadata and controls
67 lines (48 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//#include "ExperimentBlock.h"
#include "ExperimentController.h"
#include <QApplication>
#include <QCommandLineParser>
int main(int argc, char *argv[])
{
QStringList paths = QCoreApplication::libraryPaths();
paths.append(".");
QCoreApplication::setLibraryPaths(paths);
QApplication a(argc, argv);
a.setOverrideCursor(Qt::BlankCursor);
QCoreApplication::setApplicationName("EmbodiedCognitionExpirement");
QCoreApplication::setApplicationVersion("1.0");
QCommandLineParser parser;
parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
parser.setApplicationDescription(QCoreApplication::translate("main",
"Provides series of text block to measure responce time under different conditions."));
parser.addHelpOption();
parser.addVersionOption();
QCommandLineOption idOption(QStringList() << "id", QCoreApplication::translate("main", "Identificator of subject"), "subject id","");
parser.addOption(idOption);
QCommandLineOption distOption(QStringList() << "dist", QCoreApplication::translate("main", "Distance to the laptop screen in mm"), "distance in mm", "500");
parser.addOption(distOption);
QCommandLineOption colorOption(QStringList() << "color", QCoreApplication::translate("main", "Series with colored circles and text"));
parser.addOption(colorOption);
QCommandLineOption handOption(QStringList() << "hand", QCoreApplication::translate("main", "Series for hands"));
parser.addOption(handOption);
QCommandLineOption legOption(QStringList() << "leg", QCoreApplication::translate("main", "Series for legs"));
parser.addOption(legOption);
QCommandLineOption textAngleOption(QStringList() << "text_angle", QCoreApplication::translate("main", "View angle for text"), "angle in degrees", "5.0");
parser.addOption(textAngleOption);
QCommandLineOption circleAngleOption(QStringList() << "circle_angle", QCoreApplication::translate("main", "View angle for circle"), "angle in degrees", "3.2");
parser.addOption(circleAngleOption);
QCommandLineOption shiftAngleOption(QStringList() << "shift_angle", QCoreApplication::translate("main", "View angle shift"), "angle in degrees", "9.0");
parser.addOption(shiftAngleOption);
// Process the actual command line arguments given by the user
parser.process(a);
QString id = parser.value(idOption);
bool colored_series = parser.isSet(colorOption);
bool is_hand = !parser.isSet(legOption);
int distance = parser.value(distOption).toInt();
double text_angle = parser.value(textAngleOption).toDouble(),
circle_angle = parser.value(circleAngleOption).toDouble(),
shift_angle = parser.value(shiftAngleOption).toDouble();
ExpirementController controller(&a, id, colored_series, distance, is_hand, circle_angle, text_angle, shift_angle);
controller.EvaluateExperiment();
return a.exec();
}