forked from mhernando/Apolo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manageWindows.cpp
111 lines (82 loc) · 1.97 KB
/
manageWindows.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include "manageWindows.h"
ManageWindows::ManageWindows(void)
{
}
ManageWindows::~ManageWindows(void)
{
}
//Gestor de las ventanas de menus del robotsimpanel
void ManageWindows::addWindowRobotSim(RobotSimPanel* robot)
{
robotsim.push_back(robot);
}
void ManageWindows::WindowRobotSimIsClosed (RobotSimPanel* rb)
{
for (int i=0; i<(int)robotsim.size();i++)
{
if (robotsim[i]==rb)
{
RefreshVectorPages(robotsim[i]->getItemNode());
robotsim.erase(robotsim.begin()+i);
return;
}
}
}
void ManageWindows::addWindowRobotSimGoTo(RobotSimGoTo* robot)
{
robotsimgoto.push_back(robot);
}
void ManageWindows::WindowRobotSimGoToIsClosed (RobotSimGoTo* rb)
{
for (int i=0; i<(int)robotsimgoto.size();i++)
{
if (robotsimgoto[i]==rb)
{
RefreshVectorPages(robotsimgoto[i]->getItemNode());
robotsimgoto.erase(robotsimgoto.begin()+i);
return;
}
}
}
//Gestor de las ventanas de control del wheeledbase
void ManageWindows::addWindowWheeledBase(WheeledBasePanel* wh)
{
wheelebase.push_back(wh);
}
void ManageWindows::WindowWheeledBaseIsClosed (WheeledBasePanel* wh)
{
for (int i=0; i<(int)wheelebase.size();i++)
{
if (wheelebase[i]==wh)
{
RefreshVectorPages(wheelebase[i]->getItemNode());
wheelebase.erase(wheelebase.begin()+i);
return;
}
}
}
// Gestor general para evitar la duplicacion de ventanas, además de su correspondiente eliminacion
bool ManageWindows::CheckWindowsExist (NodeTree* node)
{
if (vectorwindows.empty())
{
vectorwindows.push_back(node);
return true;
}
for (int i=0; i<(int)vectorwindows.size();i++)
{
if (vectorwindows[i]==node)
return false;
}
vectorwindows.push_back(node);
return true;
}
void ManageWindows::RefreshVectorPages (NodeTree* node)
{
for (int i=0; i<(int)vectorwindows.size();i++)
if (vectorwindows[i]==node)
{
vectorwindows.erase(vectorwindows.begin()+i);
return;
}
}