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
60e50d12
Commit
60e50d12
authored
May 17, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge master
parents
282aae6c
5e95b6d2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
26 deletions
+31
-26
MainWindow.ui
src/ui/MainWindow.ui
+2
-2
WaypointEditableView.cc
src/ui/WaypointEditableView.cc
+1
-2
WaypointList.cc
src/ui/WaypointList.cc
+9
-9
WaypointViewOnlyView.cc
src/ui/WaypointViewOnlyView.cc
+5
-1
QGCMapWidget.cc
src/ui/map/QGCMapWidget.cc
+14
-12
No files found.
src/ui/MainWindow.ui
View file @
60e50d12
...
...
@@ -12,8 +12,8 @@
</property>
<property
name=
"minimumSize"
>
<size>
<width>
1024
</width>
<height>
6
00
</height>
<width>
640
</width>
<height>
4
00
</height>
</size>
</property>
<property
name=
"baseSize"
>
...
...
src/ui/WaypointEditableView.cc
View file @
60e50d12
...
...
@@ -39,11 +39,10 @@
WaypointEditableView
::
WaypointEditableView
(
Waypoint
*
wp
,
QWidget
*
parent
)
:
QWidget
(
parent
),
viewMode
(
QGC_WAYPOINTEDITABLEVIEW_MODE_DEFAULT
),
wp
(
wp
),
m_ui
(
new
Ui
::
WaypointEditableView
)
{
m_ui
->
setupUi
(
this
);
this
->
wp
=
wp
;
connect
(
wp
,
SIGNAL
(
destroyed
(
QObject
*
)),
this
,
SLOT
(
deleted
(
QObject
*
)));
// CUSTOM COMMAND WIDGET
...
...
src/ui/WaypointList.cc
View file @
60e50d12
...
...
@@ -382,13 +382,13 @@ void WaypointList::changeCurrentWaypoint(quint16 seq)
void
WaypointList
::
currentWaypointEditableChanged
(
quint16
seq
)
{
WPM
->
setCurrentEditable
(
seq
);
const
QList
<
Waypoint
*>
&
waypoints
=
WPM
->
getWaypointEditableList
();
const
QList
<
Waypoint
*>
waypoints
=
WPM
->
getWaypointEditableList
();
if
(
seq
<
waypoints
.
count
())
{
for
(
int
i
=
0
;
i
<
waypoints
.
count
();
i
++
)
{
WaypointEditableView
*
widget
=
wpEditableViews
.
find
(
waypoints
[
i
]).
value
(
);
WaypointEditableView
*
widget
=
wpEditableViews
.
value
(
waypoints
[
i
],
NULL
);
if
(
widget
)
{
if
(
waypoints
[
i
]
->
getId
()
==
seq
)
...
...
@@ -410,13 +410,13 @@ void WaypointList::currentWaypointViewOnlyChanged(quint16 seq)
// First update the edit list
currentWaypointEditableChanged
(
seq
);
const
QList
<
Waypoint
*>
&
waypoints
=
WPM
->
getWaypointViewOnlyList
();
const
QList
<
Waypoint
*>
waypoints
=
WPM
->
getWaypointViewOnlyList
();
if
(
seq
<
waypoints
.
count
())
{
for
(
int
i
=
0
;
i
<
waypoints
.
count
();
i
++
)
{
WaypointViewOnlyView
*
widget
=
wpViewOnlyViews
.
find
(
waypoints
[
i
]).
value
(
);
WaypointViewOnlyView
*
widget
=
wpViewOnlyViews
.
value
(
waypoints
[
i
],
NULL
);
if
(
widget
)
{
if
(
waypoints
[
i
]
->
getId
()
==
seq
)
...
...
@@ -467,7 +467,7 @@ void WaypointList::waypointViewOnlyListChanged()
}
}
if
(
i
==
waypoints
.
count
())
{
WaypointViewOnlyView
*
widget
=
wpViewOnlyViews
.
find
(
cur
).
value
(
);
WaypointViewOnlyView
*
widget
=
wpViewOnlyViews
.
value
(
cur
,
NULL
);
if
(
widget
)
{
widget
->
hide
();
viewOnlyListLayout
->
removeWidget
(
widget
);
...
...
@@ -523,7 +523,7 @@ void WaypointList::waypointEditableListChanged()
}
}
if
(
i
==
waypoints
.
count
())
{
WaypointEditableView
*
widget
=
wpEditableViews
.
find
(
cur
).
value
(
);
WaypointEditableView
*
widget
=
wpEditableViews
.
value
(
cur
,
NULL
);
if
(
widget
)
{
widget
->
hide
();
...
...
@@ -620,7 +620,7 @@ void WaypointList::on_clearWPListButton_clicked()
emit
clearPathclicked
();
const
QList
<
Waypoint
*>
&
waypoints
=
WPM
->
getWaypointEditableList
();
while
(
!
waypoints
.
isEmpty
())
{
WaypointEditableView
*
widget
=
wpEditableViews
.
find
(
waypoints
[
0
]).
value
(
);
WaypointEditableView
*
widget
=
wpEditableViews
.
value
(
waypoints
[
0
],
NULL
);
if
(
widget
)
{
widget
->
remove
();
}
...
...
@@ -631,14 +631,14 @@ void WaypointList::on_clearWPListButton_clicked()
void
WaypointList
::
clearWPWidget
()
{
// Get list
const
QList
<
Waypoint
*>
&
waypoints
=
WPM
->
getWaypointEditableList
();
const
QList
<
Waypoint
*>
waypoints
=
WPM
->
getWaypointEditableList
();
// XXX delete wps as well
// Clear UI elements
while
(
!
waypoints
.
isEmpty
())
{
WaypointEditableView
*
widget
=
wpEditableViews
.
find
(
waypoints
[
0
]).
value
(
);
WaypointEditableView
*
widget
=
wpEditableViews
.
value
(
waypoints
[
0
],
NULL
);
if
(
widget
)
{
widget
->
remove
();
}
...
...
src/ui/WaypointViewOnlyView.cc
View file @
60e50d12
...
...
@@ -6,10 +6,10 @@
WaypointViewOnlyView
::
WaypointViewOnlyView
(
Waypoint
*
wp
,
QWidget
*
parent
)
:
QWidget
(
parent
),
wp
(
wp
),
m_ui
(
new
Ui
::
WaypointViewOnlyView
)
{
m_ui
->
setupUi
(
this
);
this
->
wp
=
wp
;
updateValues
();
connect
(
m_ui
->
current
,
SIGNAL
(
stateChanged
(
int
)),
this
,
SLOT
(
changedCurrent
(
int
)));
...
...
@@ -60,6 +60,10 @@ void WaypointViewOnlyView::changedCurrent(int state)
void
WaypointViewOnlyView
::
setCurrent
(
bool
state
)
//This is a slot receiving signals from UASWaypointManager. The state given here is the true representation of what the "current" waypoint on UAV is.
{
if
(
!
wp
)
{
return
;
}
m_ui
->
current
->
blockSignals
(
true
);
if
(
state
==
true
)
{
...
...
src/ui/map/QGCMapWidget.cc
View file @
60e50d12
...
...
@@ -169,6 +169,12 @@ void QGCMapWidget::mouseReleaseEvent(QMouseEvent *event)
{
mousePressPos
=
event
->
pos
();
mapcontrol
::
OPMapWidget
::
mouseReleaseEvent
(
event
);
// If the mouse is released, we can't be dragging
if
(
firingWaypointChange
)
{
firingWaypointChange
=
NULL
;
}
qDebug
()
<<
"MOUSE RELEASED"
;
}
QGCMapWidget
::~
QGCMapWidget
()
...
...
@@ -620,10 +626,11 @@ void QGCMapWidget::handleMapWaypointEdit(mapcontrol::WayPointItem* waypoint)
WPDelete
(
waypoint
);
// Protect from vicious double update cycle
if
(
firingWaypointChange
==
wp
)
return
;
if
(
firingWaypointChange
==
wp
)
{
return
;
}
// Not in cycle, block now from entering it
firingWaypointChange
=
wp
;
// // qDebug() << "UPDATING WP FROM MAP";
// Update WP values
internals
::
PointLatLng
pos
=
waypoint
->
Coord
();
...
...
@@ -632,19 +639,14 @@ void QGCMapWidget::handleMapWaypointEdit(mapcontrol::WayPointItem* waypoint)
wp
->
blockSignals
(
true
);
wp
->
setLatitude
(
pos
.
Lat
());
wp
->
setLongitude
(
pos
.
Lng
());
// XXX Magic values
// wp->setAltitude(homeAltitude + 50.0f);
// wp->setAcceptanceRadius(10.0f);
wp
->
blockSignals
(
false
);
internals
::
PointLatLng
coord
=
waypoint
->
Coord
();
QString
coord_str
=
" "
+
QString
::
number
(
coord
.
Lat
(),
'f'
,
6
)
+
" "
+
QString
::
number
(
coord
.
Lng
(),
'f'
,
6
);
// // qDebug() << "MAP WP COORD (MAP):" << coord_str << __FILE__ << __LINE__;
QString
wp_str
=
QString
::
number
(
wp
->
getLatitude
(),
'f'
,
6
)
+
" "
+
QString
::
number
(
wp
->
getLongitude
(),
'f'
,
6
);
// // qDebug() << "MAP WP COORD (WP):" << wp_str << __FILE__ << __LINE__;
firingWaypointChange
=
NULL
;
// internals::PointLatLng coord = waypoint->Coord();
// QString coord_str = " " + QString::number(coord.Lat(), 'f', 6) + " " + QString::number(coord.Lng(), 'f', 6);
// qDebug() << "MAP WP COORD (MAP):" << coord_str << __FILE__ << __LINE__;
// QString wp_str = QString::number(wp->getLatitude(), 'f', 6) + " " + QString::number(wp->getLongitude(), 'f', 6);
// qDebug() << "MAP WP COORD (WP):" << wp_str << __FILE__ << __LINE__;
emit
waypointChanged
(
wp
);
}
...
...
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