Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
88671631
Commit
88671631
authored
Jun 10, 2010
by
pixhawk
Browse files
cleaned up arguments and members
parent
d02cd51b
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/Waypoint.cc
View file @
88671631
...
...
@@ -82,3 +82,23 @@ void Waypoint::setCurrent(bool current)
{
this
->
current
=
current
;
}
void
Waypoint
::
setX
(
double
x
)
{
this
->
x
=
x
;
}
void
Waypoint
::
setY
(
double
y
)
{
this
->
y
=
y
;
}
void
Waypoint
::
setZ
(
double
z
)
{
this
->
z
=
z
;
}
void
Waypoint
::
setYaw
(
double
yaw
)
{
this
->
yaw
=
yaw
;
}
src/Waypoint.h
View file @
88671631
...
...
@@ -69,6 +69,12 @@ public slots:
void
setYaw
(
float
yaw
);
void
setAutocontinue
(
bool
autoContinue
);
void
setCurrent
(
bool
current
);
//for QDoubleSpin
void
setX
(
double
x
);
void
setY
(
double
y
);
void
setZ
(
double
z
);
void
setYaw
(
double
yaw
);
};
#endif // WAYPOINT_H
src/uas/UASWaypointManager.cc
View file @
88671631
...
...
@@ -86,12 +86,12 @@ void UASWaypointManager::clearWaypointList()
}
void
UASWaypointManager
::
currentWaypointChanged
(
int
)
void
UASWaypointManager
::
currentWaypointChanged
(
qu
int
16
)
{
}
void
UASWaypointManager
::
removeWaypointId
(
int
)
void
UASWaypointManager
::
removeWaypointId
(
qu
int
16
)
{
}
...
...
@@ -121,7 +121,7 @@ void UASWaypointManager::requestWaypoints()
}
}
void
UASWaypointManager
::
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
list
)
void
UASWaypointManager
::
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
list
)
{
if
(
current_state
==
WP_IDLE
)
{
...
...
src/uas/UASWaypointManager.h
View file @
88671631
...
...
@@ -31,14 +31,14 @@ private:
public
slots
:
void
clearWaypointList
();
void
currentWaypointChanged
(
int
);
void
removeWaypointId
(
int
);
void
currentWaypointChanged
(
qu
int
16
);
void
removeWaypointId
(
qu
int
16
);
void
requestWaypoints
();
void
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
list
);
void
waypointChanged
(
Waypoint
*
);
signals:
void
waypointUpdated
(
int
,
int
,
double
,
double
,
double
,
double
,
bool
,
bool
);
///< Adds a waypoint to the waypoint list widget
void
waypointUpdated
(
int
,
qu
int
16
,
double
,
double
,
double
,
double
,
bool
,
bool
);
///< Adds a waypoint to the waypoint list widget
void
updateStatusString
(
const
QString
&
);
///< updates the current status string
private:
...
...
src/ui/WaypointList.cc
View file @
88671631
...
...
@@ -97,12 +97,12 @@ void WaypointList::setUAS(UASInterface* uas)
if
(
this
->
uas
==
NULL
&&
uas
!=
NULL
)
{
this
->
uas
=
uas
;
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
waypointUpdated
(
int
,
int
,
double
,
double
,
double
,
double
,
bool
,
bool
)),
this
,
SLOT
(
setWaypoint
(
int
,
int
,
double
,
double
,
double
,
double
,
bool
,
bool
)));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
waypointReached
(
UASInterface
*
,
int
)),
this
,
SLOT
(
w
aypoint
Reached
(
UASInterface
*
,
int
)));
connect
(
this
,
SIGNAL
(
w
aypointChanged
(
Waypo
int
*
)),
&
uas
->
getWaypointManager
(),
SLOT
(
setWaypoint
(
Waypo
int
*
)));
connect
(
this
,
SIGNAL
(
curr
en
t
Waypoint
Changed
(
int
)),
&
uas
->
getWaypointManager
(),
SLOT
(
se
t
Waypoint
Active
(
int
)));
connect
(
this
,
SIGNAL
(
requestWaypoints
()),
&
uas
->
getWaypointManager
(),
SLOT
(
requestWaypoints
()));
connect
(
this
,
SIGNAL
(
clearWaypointList
()),
&
uas
->
getWaypointManager
(),
SLOT
(
clearWaypointList
()));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
waypointUpdated
(
int
,
qu
int
16
,
double
,
double
,
double
,
double
,
bool
,
bool
)),
this
,
SLOT
(
setWaypoint
(
int
,
qu
int
16
,
double
,
double
,
double
,
double
,
bool
,
bool
)));
//
connect(
this, SIGNAL(waypointChanged(Waypo
int
*
)),
&uas->getWaypointManager()
, SLOT(
setW
aypoint
(Waypo
int
*
)));
//
connect(this, SIGNAL(
currentW
aypointChanged(int)), &uas->getWaypointManager(), SLOT(setWaypoint
Active(qu
int
16
)));
connect
(
this
,
SIGNAL
(
s
en
d
Waypoint
s
(
const
QVector
<
Waypoint
*>
&
)),
&
uas
->
getWaypointManager
(),
SLOT
(
se
nd
Waypoint
s
(
const
QVector
<
Waypoint
*>
&
)));
connect
(
this
,
SIGNAL
(
requestWaypoints
()),
&
uas
->
getWaypointManager
(),
SLOT
(
requestWaypoints
()));
connect
(
this
,
SIGNAL
(
clearWaypointList
()),
&
uas
->
getWaypointManager
(),
SLOT
(
clearWaypointList
()));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
updateStatusString
(
const
QString
&
)),
this
,
SLOT
(
updateStatusLabel
(
const
QString
&
)));
...
...
@@ -113,24 +113,17 @@ void WaypointList::setUAS(UASInterface* uas)
}
}
void
WaypointList
::
setWaypoint
(
int
uasId
,
int
id
,
double
x
,
double
y
,
double
z
,
double
yaw
,
bool
autocontinue
,
bool
current
)
void
WaypointList
::
setWaypoint
(
int
uasId
,
qu
int
16
id
,
double
x
,
double
y
,
double
z
,
double
yaw
,
bool
autocontinue
,
bool
current
)
{
if
(
uasId
==
this
->
uas
->
getUASID
())
{
transmitDelay
->
start
(
1000
);
QString
string
=
"New waypoint"
;
if
(
waypointNames
.
contains
(
id
))
{
string
=
waypointNames
.
value
(
id
);
}
Waypoint
*
wp
=
new
Waypoint
(
id
,
x
,
y
,
z
,
yaw
,
autocontinue
,
current
);
addWaypoint
(
wp
);
}
}
void
WaypointList
::
waypointReached
(
UASInterface
*
uas
,
int
waypointId
)
void
WaypointList
::
waypointReached
(
UASInterface
*
uas
,
qu
int
16
waypointId
)
{
Q_UNUSED
(
uas
);
qDebug
()
<<
"Waypoint reached: "
<<
waypointId
;
...
...
@@ -170,16 +163,17 @@ void WaypointList::transmit()
transmitDelay
->
start
(
1000
);
m_ui
->
transmitButton
->
setEnabled
(
false
);
emit
clearWaypointList
();
waypointNames
.
clear
();
for
(
int
i
=
0
;
i
<
waypoints
.
size
();
i
++
)
{
//Waypoint* wp = waypoints[i];
/*waypointNames.insert(wp->id, wp->name);
emit waypointChanged(wp);
if (wp->current)
emit currentWaypointChanged(wp->id);*/
//emit waypointChanged(wp);
//if (wp->current)
// emit currentWaypointChanged(wp->id);
}
emit
sendWaypoints
(
waypoints
);
while
(
waypoints
.
size
()
>
0
)
{
removeWaypoint
(
waypoints
[
0
]);
...
...
@@ -219,7 +213,7 @@ void WaypointList::addWaypoint(Waypoint* wp)
listLayout
->
addWidget
(
wpViews
.
value
(
wp
));
connect
(
wpview
,
SIGNAL
(
moveDownWaypoint
(
Waypoint
*
)),
this
,
SLOT
(
moveDown
(
Waypoint
*
)));
connect
(
wpview
,
SIGNAL
(
moveUpWaypoint
(
Waypoint
*
)),
this
,
SLOT
(
moveUp
(
Waypoint
*
)));
connect
(
wpview
,
SIGNAL
(
removeWaypoint
(
Waypoint
*
)),
this
,
SLOT
(
removeWaypoint
AndName
(
Waypoint
*
)));
connect
(
wpview
,
SIGNAL
(
removeWaypoint
(
Waypoint
*
)),
this
,
SLOT
(
removeWaypoint
(
Waypoint
*
)));
connect
(
wpview
,
SIGNAL
(
setCurrentWaypoint
(
Waypoint
*
)),
this
,
SLOT
(
setCurrentWaypoint
(
Waypoint
*
)));
connect
(
wpview
,
SIGNAL
(
waypointUpdated
(
Waypoint
*
)),
this
,
SIGNAL
(
waypointChanged
(
Waypoint
*
)));
}
...
...
@@ -293,11 +287,10 @@ void WaypointList::moveDown(Waypoint* wp)
}
}
void
WaypointList
::
removeWaypointAndName
(
Waypoint
*
wp
)
/*
void WaypointList::removeWaypointAndName(Waypoint* wp)
{
waypointNames
.
remove
(
wp
->
getId
());
removeWaypoint(wp);
}
}
*/
void
WaypointList
::
removeWaypoint
(
Waypoint
*
wp
)
{
...
...
@@ -382,7 +375,7 @@ void WaypointList::loadWaypoints()
while
(
waypoints
.
size
()
>
0
)
{
removeWaypoint
AndName
(
waypoints
[
0
]);
removeWaypoint
(
waypoints
[
0
]);
}
QTextStream
in
(
&
file
);
...
...
src/ui/WaypointList.h
View file @
88671631
...
...
@@ -71,17 +71,15 @@ public slots:
void
updateStatusLabel
(
const
QString
&
string
);
//To be moved to UASWaypointManager (?)
void
setWaypoint
(
int
uasId
,
int
id
,
double
x
,
double
y
,
double
z
,
double
yaw
,
bool
autocontinue
,
bool
current
);
void
setWaypoint
(
int
uasId
,
qu
int
16
id
,
double
x
,
double
y
,
double
z
,
double
yaw
,
bool
autocontinue
,
bool
current
);
void
addWaypoint
(
Waypoint
*
wp
);
void
removeWaypoint
AndName
(
Waypoint
*
wp
);
void
waypointReached
(
UASInterface
*
uas
,
int
waypointId
);
void
removeWaypoint
(
Waypoint
*
wp
);
void
waypointReached
(
UASInterface
*
uas
,
qu
int
16
waypointId
);
protected:
virtual
void
changeEvent
(
QEvent
*
e
);
void
debugOutputWaypoints
();
QVector
<
Waypoint
*>
waypoints
;
QMap
<
int
,
QString
>
waypointNames
;
QMap
<
Waypoint
*
,
WaypointView
*>
wpViews
;
QVBoxLayout
*
listLayout
;
QTimer
*
transmitDelay
;
...
...
@@ -89,12 +87,12 @@ protected:
private:
Ui
::
WaypointList
*
m_ui
;
void
removeWaypoint
(
Waypoint
*
wp
);
signals:
void
waypointChanged
(
Waypoint
*
);
void
currentWaypointChanged
(
int
);
void
removeWaypointId
(
int
);
//void waypointChanged(Waypoint*);
//void currentWaypointChanged(int);
//void removeWaypointId(int);
void
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
);
void
requestWaypoints
();
void
clearWaypointList
();
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment