forked from torriem/QtAgOpenGPS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
94 lines (83 loc) · 2.77 KB
/
main.cpp
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#include "formgps.h"
#include <QApplication>
#include <QCoreApplication>
#include <QLabel>
#include "aogrenderer.h"
#include "aogproperty.h"
QLabel *grnPixelsWindow;
AOGSettings *settings;
#ifndef TESTING
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QFont f = a.font();
f.setPointSize(16);
a.setFont(f);
QCoreApplication::setOrganizationName("QtAgOpenGPS");
QCoreApplication::setOrganizationDomain("qtagopengps");
QCoreApplication::setApplicationName("QtAgOpenGPS");
QSettings::setDefaultFormat(QSettings::IniFormat);
QSettings::setPath(QSettings::IniFormat,
QSettings::UserScope,
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
//We're supposed to be compatible with the saved data
//from this version of AOG:
QCoreApplication::setApplicationVersion("4.1.0");
qmlRegisterType<AOGRendererInSG>("AgOpenGPS",1,0,"AOGRenderer");
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qRegisterMetaTypeStreamOperators<QList<int> >("QList<int>");
qRegisterMetaTypeStreamOperators<QVector<int> >("QVector<int>");
#endif
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
settings = new AOGSettings();
AOGProperty::init_defaults();
settings->sync();
FormGPS w;
//w.show();
if (property_displayShowBack) {
grnPixelsWindow = new QLabel("Back Buffer");
grnPixelsWindow->setFixedWidth(500);
grnPixelsWindow->setFixedHeight(500);
grnPixelsWindow->show();
}
/*
CDubinsTurningRadius = 5.25;
CDubins c;
Vec3 start(0,0,0);
Vec3 goal (8,0,0);
QVector<Vec3> pathlist;
pathlist = c.GenerateDubins(start, goal);
foreach(Vec3 goal: pathlist) {
qDebug() << goal.easting<< ", "<<goal.northing;
}
return 0;
*/
//Test file I/O
//w.fileSaveCurveLines();
//w.fileSaveBoundary();
//w.fileSaveABLines();
//w.fileSaveContour();
//w.fileSaveVehicle("/tmp/TestVehicle.txt");
//w.fileOpenField("49111 1 1 2020.Mar.21 09_58");
//w.ABLine.isBtnABLineOn = true;
//w.hd.isOn = true;
//w.yt.isYouTurnBtnOn = true;
//w.ABLine.isBtnABLineOn = true;
//w.fileOpenTool("/tmp/TestTool1.txt");
//w.fileOpenVehicle("/tmp/TestVehicle2.txt");
//w.fileSaveTool("/tmp/TestTool.TXT");
/*
//testing to see how locale affects numbers in the stream writer
QFileInfo testit("/tmp/noexistant/file.txt");
qDebug() << testit.baseName();
qDebug() << testit.suffix();
QFile testFile("/tmp/test.txt");
testFile.open(QIODevice::WriteOnly);
QTextStream writer(&testFile);
writer << "Testing" << Qt::endl;
writer << qSetFieldWidth(3) << (double)3.1415926535 << Qt::endl;
testFile.close();
*/
return a.exec();
}
#endif