Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
88671631
Commit
88671631
authored
Jun 10, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaned up arguments and members
parent
d02cd51b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
40 deletions
+57
-40
Waypoint.cc
src/Waypoint.cc
+20
-0
Waypoint.h
src/Waypoint.h
+6
-0
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+3
-3
UASWaypointManager.h
src/uas/UASWaypointManager.h
+3
-3
WaypointList.cc
src/ui/WaypointList.cc
+18
-25
WaypointList.h
src/ui/WaypointList.h
+7
-9
No files found.
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
(
quint16
)
{
}
void
UASWaypointManager
::
removeWaypointId
(
int
)
void
UASWaypointManager
::
removeWaypointId
(
quint16
)
{
}
...
...
@@ -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
(
quint16
);
void
removeWaypointId
(
quint16
);
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
,
quint16
,
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
(
waypointReached
(
UASInterface
*
,
int
)));
connect
(
this
,
SIGNAL
(
waypointChanged
(
Waypoint
*
)),
&
uas
->
getWaypointManager
(),
SLOT
(
setWaypoint
(
Waypoint
*
)));
connect
(
this
,
SIGNAL
(
currentWaypointChanged
(
int
)),
&
uas
->
getWaypointManager
(),
SLOT
(
setWaypointActive
(
int
)));
connect
(
this
,
SIGNAL
(
requestWaypoints
()),
&
uas
->
getWaypointManager
(),
SLOT
(
requestWaypoints
()));
connect
(
this
,
SIGNAL
(
clearWaypointList
()),
&
uas
->
getWaypointManager
(),
SLOT
(
clearWaypointList
()));
connect
(
&
uas
->
getWaypointManager
(),
SIGNAL
(
waypointUpdated
(
int
,
quint16
,
double
,
double
,
double
,
double
,
bool
,
bool
)),
this
,
SLOT
(
setWaypoint
(
int
,
quint16
,
double
,
double
,
double
,
double
,
bool
,
bool
)));
//connect(this, SIGNAL(waypointChanged(Waypoint*)), &uas->getWaypointManager(), SLOT(setWaypoint(Waypoint*
)));
//connect(this, SIGNAL(currentWaypointChanged(int)), &uas->getWaypointManager(), SLOT(setWaypointActive(quint16
)));
connect
(
this
,
SIGNAL
(
sendWaypoints
(
const
QVector
<
Waypoint
*>
&
)),
&
uas
->
getWaypointManager
(),
SLOT
(
sendWaypoints
(
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
,
quint16
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
,
quint16
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
,
quint16
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
,
quint16
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
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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