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
a13508b3
Commit
a13508b3
authored
May 24, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allowed offline editing of waypoints
parent
42de6b7c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
49 deletions
+58
-49
QGCWaypointListMulti.cc
src/ui/QGCWaypointListMulti.cc
+2
-2
WaypointList.cc
src/ui/WaypointList.cc
+55
-46
WaypointList.h
src/ui/WaypointList.h
+1
-1
No files found.
src/ui/QGCWaypointListMulti.cc
View file @
a13508b3
...
@@ -12,7 +12,7 @@ QGCWaypointListMulti::QGCWaypointListMulti(QWidget *parent) :
...
@@ -12,7 +12,7 @@ QGCWaypointListMulti::QGCWaypointListMulti(QWidget *parent) :
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
this
,
SLOT
(
systemCreated
(
UASInterface
*
)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
this
,
SLOT
(
systemCreated
(
UASInterface
*
)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
int
)),
this
,
SLOT
(
systemSetActive
(
int
)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
int
)),
this
,
SLOT
(
systemSetActive
(
int
)));
WaypointList
*
list
=
new
WaypointList
(
ui
->
stackedWidget
,
NULL
);
WaypointList
*
list
=
new
WaypointList
(
ui
->
stackedWidget
,
UASManager
::
instance
()
->
getActiveUASWaypointManager
()
);
lists
.
insert
(
offline_uas_id
,
list
);
lists
.
insert
(
offline_uas_id
,
list
);
ui
->
stackedWidget
->
addWidget
(
list
);
ui
->
stackedWidget
->
addWidget
(
list
);
...
@@ -40,7 +40,7 @@ void QGCWaypointListMulti::systemDeleted(QObject* uas)
...
@@ -40,7 +40,7 @@ void QGCWaypointListMulti::systemDeleted(QObject* uas)
void
QGCWaypointListMulti
::
systemCreated
(
UASInterface
*
uas
)
void
QGCWaypointListMulti
::
systemCreated
(
UASInterface
*
uas
)
{
{
WaypointList
*
list
=
new
WaypointList
(
ui
->
stackedWidget
,
uas
);
WaypointList
*
list
=
new
WaypointList
(
ui
->
stackedWidget
,
uas
->
getWaypointManager
()
);
lists
.
insert
(
uas
->
getUASID
(),
list
);
lists
.
insert
(
uas
->
getUASID
(),
list
);
ui
->
stackedWidget
->
addWidget
(
list
);
ui
->
stackedWidget
->
addWidget
(
list
);
// Ensure widget is deleted when system is deleted
// Ensure widget is deleted when system is deleted
...
...
src/ui/WaypointList.cc
View file @
a13508b3
...
@@ -34,15 +34,17 @@ This file is part of the PIXHAWK project
...
@@ -34,15 +34,17 @@ This file is part of the PIXHAWK project
#include "WaypointList.h"
#include "WaypointList.h"
#include "ui_WaypointList.h"
#include "ui_WaypointList.h"
#include <UASInterface.h>
#include <UASInterface.h>
#include <UAS.h>
#include <UASManager.h>
#include <UASManager.h>
#include <QDebug>
#include <QDebug>
#include <QFileDialog>
#include <QFileDialog>
#include <QMessageBox>
#include <QMessageBox>
#include <QMouseEvent>
#include <QMouseEvent>
WaypointList
::
WaypointList
(
QWidget
*
parent
,
UAS
Interface
*
uas
)
:
WaypointList
::
WaypointList
(
QWidget
*
parent
,
UAS
WaypointManager
*
wpm
)
:
QWidget
(
parent
),
QWidget
(
parent
),
uas
(
NULL
),
uas
(
NULL
),
WPM
(
wpm
),
mavX
(
0.0
),
mavX
(
0.0
),
mavY
(
0.0
),
mavY
(
0.0
),
mavZ
(
0.0
),
mavZ
(
0.0
),
...
@@ -96,28 +98,32 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) :
...
@@ -96,28 +98,32 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) :
connect
(
m_ui
->
refreshButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
refresh
()));
connect
(
m_ui
->
refreshButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
refresh
()));
if
(
WPM
)
{
// SET UAS AFTER ALL SIGNALS/SLOTS ARE CONNECTED
if
(
!
WPM
->
getUAS
())
{
// Hide buttons, which don't make sense without valid UAS
m_ui
->
positionAddButton
->
hide
();
m_ui
->
transmitButton
->
hide
();
m_ui
->
readButton
->
hide
();
m_ui
->
refreshButton
->
hide
();
//FIXME: The whole "Onboard Waypoints"-tab should be hidden, instead of "refresh" button
UnconnectedUASInfoWidget
*
inf
=
new
UnconnectedUASInfoWidget
(
this
);
viewOnlyListLayout
->
insertWidget
(
0
,
inf
);
//insert a "NO UAV" info into the Onboard Tab
showOfflineWarning
=
true
;
}
else
{
setUAS
(
static_cast
<
UASInterface
*>
(
WPM
->
getUAS
()));
}
// SET UAS AFTER ALL SIGNALS/SLOTS ARE CONNECTED
/* connect slots */
if
(
uas
)
connect
(
WPM
,
SIGNAL
(
updateStatusString
(
const
QString
&
)),
this
,
SLOT
(
updateStatusLabel
(
const
QString
&
)));
{
connect
(
WPM
,
SIGNAL
(
waypointEditableListChanged
(
void
)),
this
,
SLOT
(
waypointEditableListChanged
(
void
)));
WPM
=
uas
->
getWaypointManager
();
connect
(
WPM
,
SIGNAL
(
waypointEditableChanged
(
int
,
Waypoint
*
)),
this
,
SLOT
(
updateWaypointEditable
(
int
,
Waypoint
*
)));
}
connect
(
WPM
,
SIGNAL
(
waypointViewOnlyListChanged
(
void
)),
this
,
SLOT
(
waypointViewOnlyListChanged
(
void
)));
else
connect
(
WPM
,
SIGNAL
(
waypointViewOnlyChanged
(
int
,
Waypoint
*
)),
this
,
SLOT
(
updateWaypointViewOnly
(
int
,
Waypoint
*
)));
{
connect
(
WPM
,
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
currentWaypointViewOnlyChanged
(
quint16
)));
// Hide buttons, which don't make sense without valid UAS
m_ui
->
positionAddButton
->
hide
();
m_ui
->
transmitButton
->
hide
();
m_ui
->
readButton
->
hide
();
m_ui
->
refreshButton
->
hide
();
//FIXME: The whole "Onboard Waypoints"-tab should be hidden, instead of "refresh" button
UnconnectedUASInfoWidget
*
inf
=
new
UnconnectedUASInfoWidget
(
this
);
viewOnlyListLayout
->
insertWidget
(
0
,
inf
);
//insert a "NO UAV" info into the Onboard Tab
showOfflineWarning
=
true
;
WPM
=
new
UASWaypointManager
(
NULL
);
}
}
setUAS
(
uas
);
// STATUS LABEL
// STATUS LABEL
updateStatusLabel
(
""
);
updateStatusLabel
(
""
);
...
@@ -154,28 +160,38 @@ void WaypointList::updateAttitude(UASInterface* uas, double roll, double pitch,
...
@@ -154,28 +160,38 @@ void WaypointList::updateAttitude(UASInterface* uas, double roll, double pitch,
void
WaypointList
::
setUAS
(
UASInterface
*
uas
)
void
WaypointList
::
setUAS
(
UASInterface
*
uas
)
{
{
if
(
this
->
uas
==
NULL
&&
uas
!=
NULL
)
if
(
!
uas
)
{
return
;
WPM
=
uas
->
getWaypointManager
();
}
if
(
this
->
uas
!=
NULL
)
if
(
this
->
uas
==
NULL
)
{
{
this
->
uas
=
uas
;
// Clear current list
connect
(
WPM
,
SIGNAL
(
updateStatusString
(
const
QString
&
)),
this
,
SLOT
(
updateStatusLabel
(
const
QString
&
)));
on_clearWPListButton_clicked
();
connect
(
WPM
,
SIGNAL
(
waypointEditableListChanged
(
void
)),
this
,
SLOT
(
waypointEditableListChanged
(
void
)));
// Disconnect everything
connect
(
WPM
,
SIGNAL
(
waypointEditableChanged
(
int
,
Waypoint
*
)),
this
,
SLOT
(
updateWaypointEditable
(
int
,
Waypoint
*
)));
disconnect
(
WPM
,
SIGNAL
(
updateStatusString
(
const
QString
&
)),
this
,
SLOT
(
updateStatusLabel
(
const
QString
&
)));
connect
(
WPM
,
SIGNAL
(
waypointViewOnlyListChanged
(
void
)),
this
,
SLOT
(
waypointViewOnlyListChanged
(
void
)));
disconnect
(
WPM
,
SIGNAL
(
waypointEditableListChanged
(
void
)),
this
,
SLOT
(
waypointEditableListChanged
(
void
)));
connect
(
WPM
,
SIGNAL
(
waypointViewOnlyChanged
(
int
,
Waypoint
*
)),
this
,
SLOT
(
updateWaypointViewOnly
(
int
,
Waypoint
*
)));
disconnect
(
WPM
,
SIGNAL
(
waypointEditableChanged
(
int
,
Waypoint
*
)),
this
,
SLOT
(
updateWaypointEditable
(
int
,
Waypoint
*
)));
connect
(
WPM
,
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
currentWaypointViewOnlyChanged
(
quint16
)));
disconnect
(
WPM
,
SIGNAL
(
waypointViewOnlyListChanged
(
void
)),
this
,
SLOT
(
waypointViewOnlyListChanged
(
void
)));
if
(
uas
!=
NULL
)
disconnect
(
WPM
,
SIGNAL
(
waypointViewOnlyChanged
(
int
,
Waypoint
*
)),
this
,
SLOT
(
updateWaypointViewOnly
(
int
,
Waypoint
*
)));
{
disconnect
(
WPM
,
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
currentWaypointViewOnlyChanged
(
quint16
)));
connect
(
uas
,
SIGNAL
(
localPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updatePosition
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
disconnect
(
this
->
uas
,
SIGNAL
(
localPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updatePosition
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
uas
,
SIGNAL
(
attitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateAttitude
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
disconnect
(
this
->
uas
,
SIGNAL
(
attitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateAttitude
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
}
//connect(WPM,SIGNAL(loadWPFile()),this,SLOT(setIsLoadFileWP()));
//connect(WPM,SIGNAL(readGlobalWPFromUAS(bool)),this,SLOT(setIsReadGlobalWP(bool)));
}
}
WPM
=
uas
->
getWaypointManager
();
this
->
uas
=
uas
;
connect
(
WPM
,
SIGNAL
(
updateStatusString
(
const
QString
&
)),
this
,
SLOT
(
updateStatusLabel
(
const
QString
&
)));
connect
(
WPM
,
SIGNAL
(
waypointEditableListChanged
(
void
)),
this
,
SLOT
(
waypointEditableListChanged
(
void
)));
connect
(
WPM
,
SIGNAL
(
waypointEditableChanged
(
int
,
Waypoint
*
)),
this
,
SLOT
(
updateWaypointEditable
(
int
,
Waypoint
*
)));
connect
(
WPM
,
SIGNAL
(
waypointViewOnlyListChanged
(
void
)),
this
,
SLOT
(
waypointViewOnlyListChanged
(
void
)));
connect
(
WPM
,
SIGNAL
(
waypointViewOnlyChanged
(
int
,
Waypoint
*
)),
this
,
SLOT
(
updateWaypointViewOnly
(
int
,
Waypoint
*
)));
connect
(
WPM
,
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
currentWaypointViewOnlyChanged
(
quint16
)));
connect
(
uas
,
SIGNAL
(
localPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updatePosition
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
uas
,
SIGNAL
(
attitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateAttitude
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
//connect(WPM,SIGNAL(loadWPFile()),this,SLOT(setIsLoadFileWP()));
//connect(WPM,SIGNAL(readGlobalWPFromUAS(bool)),this,SLOT(setIsReadGlobalWP(bool)));
// Update list
// Update list
read
();
read
();
}
}
...
@@ -583,8 +599,6 @@ void WaypointList::changeEvent(QEvent *e)
...
@@ -583,8 +599,6 @@ void WaypointList::changeEvent(QEvent *e)
void
WaypointList
::
on_clearWPListButton_clicked
()
void
WaypointList
::
on_clearWPListButton_clicked
()
{
{
if
(
uas
)
{
if
(
uas
)
{
emit
clearPathclicked
();
emit
clearPathclicked
();
const
QVector
<
Waypoint
*>
&
waypoints
=
WPM
->
getWaypointEditableList
();
const
QVector
<
Waypoint
*>
&
waypoints
=
WPM
->
getWaypointEditableList
();
...
@@ -592,11 +606,6 @@ void WaypointList::on_clearWPListButton_clicked()
...
@@ -592,11 +606,6 @@ void WaypointList::on_clearWPListButton_clicked()
WaypointEditableView
*
widget
=
wpEditableViews
.
find
(
waypoints
[
0
]).
value
();
WaypointEditableView
*
widget
=
wpEditableViews
.
find
(
waypoints
[
0
]).
value
();
widget
->
remove
();
widget
->
remove
();
}
}
}
else
{
// if(isGlobalWP)
// {
// emit clearPathclicked();
// }
}
}
}
}
...
...
src/ui/WaypointList.h
View file @
a13508b3
...
@@ -56,7 +56,7 @@ class WaypointList : public QWidget
...
@@ -56,7 +56,7 @@ class WaypointList : public QWidget
Q_OBJECT
Q_OBJECT
Q_DISABLE_COPY
(
WaypointList
)
Q_DISABLE_COPY
(
WaypointList
)
public:
public:
WaypointList
(
QWidget
*
parent
=
NULL
,
UAS
Interface
*
uas
=
NULL
);
WaypointList
(
QWidget
*
parent
=
NULL
,
UAS
WaypointManager
*
wpm
=
NULL
);
virtual
~
WaypointList
();
virtual
~
WaypointList
();
public
slots
:
public
slots
:
...
...
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