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
6fcdce98
Commit
6fcdce98
authored
Feb 17, 2011
by
lm
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of pixhawk.ethz.ch:qgroundcontrol into experimental
parents
93234dcc
b6a40520
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
39 deletions
+44
-39
WaypointList.cc
src/ui/WaypointList.cc
+43
-38
WaypointView.cc
src/ui/WaypointView.cc
+1
-1
No files found.
src/ui/WaypointList.cc
View file @
6fcdce98
...
...
@@ -278,56 +278,61 @@ void WaypointList::waypointListChanged()
this
->
setUpdatesEnabled
(
false
);
const
QVector
<
Waypoint
*>
&
waypoints
=
uas
->
getWaypointManager
()
->
getWaypointList
();
if
(
!
wpViews
.
empty
())
if
(
!
wpViews
.
empty
())
{
QMapIterator
<
Waypoint
*
,
WaypointView
*>
viewIt
(
wpViews
);
viewIt
.
toFront
();
while
(
viewIt
.
hasNext
())
{
QMapIterator
<
Waypoint
*
,
WaypointView
*>
viewIt
(
wpViews
);
viewIt
.
toFront
();
while
(
viewIt
.
hasNext
())
viewIt
.
next
();
Waypoint
*
cur
=
viewIt
.
key
();
int
i
;
for
(
i
=
0
;
i
<
waypoints
.
size
();
i
++
)
{
viewIt
.
next
();
Waypoint
*
cur
=
viewIt
.
key
();
int
i
;
for
(
i
=
0
;
i
<
waypoints
.
size
();
i
++
)
{
if
(
waypoints
[
i
]
==
cur
)
{
break
;
}
}
if
(
i
==
waypoints
.
size
())
if
(
waypoints
[
i
]
==
cur
)
{
WaypointView
*
widget
=
wpViews
.
find
(
cur
).
value
();
widget
->
hide
();
listLayout
->
removeWidget
(
widget
);
wpViews
.
remove
(
cur
);
break
;
}
}
}
// then add/update the views for each waypoint in the list
for
(
int
i
=
0
;
i
<
waypoints
.
size
();
i
++
)
{
Waypoint
*
wp
=
waypoints
[
i
];
if
(
!
wpViews
.
contains
(
wp
))
if
(
i
==
waypoints
.
size
())
{
WaypointView
*
wpview
=
new
WaypointView
(
wp
,
this
);
wpViews
.
insert
(
wp
,
wpview
);
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
(
Waypoint
*
)));
connect
(
wpview
,
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
currentWaypointChanged
(
quint16
)));
connect
(
wpview
,
SIGNAL
(
changeCurrentWaypoint
(
quint16
)),
this
,
SLOT
(
changeCurrentWaypoint
(
quint16
)));
WaypointView
*
widget
=
wpViews
.
find
(
cur
).
value
();
widget
->
hide
();
listLayout
->
removeWidget
(
widget
);
wpViews
.
remove
(
cur
);
}
WaypointView
*
wpv
=
wpViews
.
value
(
wp
);
wpv
->
updateValues
();
// update the values of the ui elements in the view
listLayout
->
addWidget
(
wpv
);
}
this
->
setUpdatesEnabled
(
true
);
}
// then add/update the views for each waypoint in the list
for
(
int
i
=
0
;
i
<
waypoints
.
size
();
i
++
)
{
Waypoint
*
wp
=
waypoints
[
i
];
if
(
!
wpViews
.
contains
(
wp
))
{
WaypointView
*
wpview
=
new
WaypointView
(
wp
,
this
);
wpViews
.
insert
(
wp
,
wpview
);
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
(
Waypoint
*
)));
connect
(
wpview
,
SIGNAL
(
currentWaypointChanged
(
quint16
)),
this
,
SLOT
(
currentWaypointChanged
(
quint16
)));
connect
(
wpview
,
SIGNAL
(
changeCurrentWaypoint
(
quint16
)),
this
,
SLOT
(
changeCurrentWaypoint
(
quint16
)));
listLayout
->
insertWidget
(
i
,
wpview
);
}
WaypointView
*
wpv
=
wpViews
.
value
(
wp
);
//check if ordering has changed
if
(
listLayout
->
itemAt
(
i
)
->
widget
()
!=
wpv
)
{
listLayout
->
removeWidget
(
wpv
);
listLayout
->
insertWidget
(
i
,
wpv
);
}
wpv
->
updateValues
();
// update the values of the ui elements in the view
}
this
->
setUpdatesEnabled
(
true
);
loadFileGlobalWP
=
false
;
}
}
//void WaypointList::waypointListChanged()
...
...
src/ui/WaypointView.cc
View file @
6fcdce98
...
...
@@ -530,7 +530,7 @@ void WaypointView::updateValues()
void
WaypointView
::
setCurrent
(
bool
state
)
{
m_ui
->
selectedBox
->
blockSignals
(
true
);
m_ui
->
selectedBox
->
setChecked
(
state
);
;
m_ui
->
selectedBox
->
setChecked
(
state
);
m_ui
->
selectedBox
->
blockSignals
(
false
);
}
...
...
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