-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplaytextv1.cpp
More file actions
63 lines (53 loc) · 1.82 KB
/
displaytextv1.cpp
File metadata and controls
63 lines (53 loc) · 1.82 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
#include "displaytextv1.h"
#include "ui_displaytextv1.h"
AllRoutes *DisplayTextV1::getAllRoutes() const
{
return allRoutes;
}
void DisplayTextV1::setAllRoutes(AllRoutes *value)
{
allRoutes = value;
}
DisplayTextV1::DisplayTextV1(QWidget *parent) :
QDialog(parent),
ui(new Ui::DisplayTextV1)
{
ui->setupUi(this);
}
DisplayTextV1::~DisplayTextV1()
{
delete ui;
}
void DisplayTextV1::setupUI(){
APWidgetText1 *apglWidget = findChild<APWidgetText1 *>("apglwidget",Qt::FindChildrenRecursively);
//Set first Leg flag
Route tempRoute;
SubRoute tempSubRoute;
Leg tempLeg;
std::vector<Leg> tempLegs;
std::vector<SubRoute> tempSubRoutes;
std::vector<Route> tempRoutes;
//set only the first two routes for this display.
// tempRoutes = allRoutes->getRoutes();
tempRoutes.push_back(allRoutes->getRoutes().at(0)); // original route
tempRoutes.push_back(allRoutes->getRoutes().at(1)); // next best
allRoutes->setRoutes(tempRoutes); // reset the original routes
for(int i = 0 ; i < allRoutes->getRoutes().size(); i++){
tempRoute = allRoutes->getRoutes().at(i);
tempSubRoutes = tempRoute.getSubRoutes();
for(int j = 0 ; j < tempRoute.getSubRoutes().size(); j++){
tempSubRoute = tempRoute.getSubRoutes().at(j);
tempLegs = tempSubRoute.getLegs();
tempLeg = tempLegs.at(0); // index of first leg
tempLeg.isFirstLeg = true;
tempLegs[0] = tempLeg;
tempSubRoute.setLegs(tempLegs);
tempSubRoutes[j] = tempSubRoute;
}
tempRoute.setSubRoutes(tempSubRoutes);
tempRoutes[i] = tempRoute;
}
allRoutes->setRoutes(tempRoutes);
apglWidget->allRoutes = allRoutes;
apglWidget->updateGL();
}