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
3805b4cc
Commit
3805b4cc
authored
Oct 05, 2011
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed changing "current" bugs. Should now work as intended.
parent
c3ff739f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
20 deletions
+16
-20
UASWaypointManager.cc
src/uas/UASWaypointManager.cc
+1
-14
WaypointEditableView.cc
src/ui/WaypointEditableView.cc
+7
-4
WaypointList.cc
src/ui/WaypointList.cc
+8
-2
No files found.
src/uas/UASWaypointManager.cc
View file @
3805b4cc
...
...
@@ -173,7 +173,7 @@ void UASWaypointManager::handleWaypoint(quint8 systemId, quint8 compId, mavlink_
protocol_timer
.
stop
();
emit
readGlobalWPFromUAS
(
false
);
if
(
currentWaypointEditable
)
emit
currentWaypointChanged
(
currentWaypointEditable
->
getId
());
//
if (currentWaypointEditable) emit currentWaypointChanged(currentWaypointEditable->getId());
emit
updateStatusString
(
"done."
);
// // qDebug() << "got all waypoints from ID " << systemId;
...
...
@@ -283,19 +283,6 @@ int UASWaypointManager::setCurrentWaypoint(quint16 seq)
if
(
seq
<
waypointsViewOnly
.
size
())
{
if
(
current_state
==
WP_IDLE
)
{
/*
//update local main storage
for(int i = 0; i < waypointsViewOnly.size(); i++) {
if (waypointsViewOnly[i]->getId() == seq) {
waypointsViewOnly[i]->setCurrent(true);
//currentWaypointEditable = waypoints[i];
} else {
waypointsViewOnly[i]->setCurrent(false);
}
}
*/
//send change to UAS - important to note: if the transmission fails, we have inconsistencies
protocol_timer
.
start
(
PROTOCOL_TIMEOUT_MS
);
current_retries
=
PROTOCOL_MAX_RETRIES
;
...
...
src/ui/WaypointEditableView.cc
View file @
3805b4cc
...
...
@@ -359,27 +359,30 @@ void WaypointEditableView::changedFrame(int index)
void
WaypointEditableView
::
changedCurrent
(
int
state
)
{
m_ui
->
selectedBox
->
blockSignals
(
true
);
//
m_ui->selectedBox->blockSignals(true);
if
(
state
==
0
)
{
if
(
wp
->
getCurrent
()
==
true
)
//User clicked on the waypoint, that is already current
{
qDebug
()
<<
"Editable "
<<
wp
->
getId
()
<<
" changedCurrent: State 0, current true"
;
m_ui
->
selectedBox
->
setChecked
(
true
);
m_ui
->
selectedBox
->
setCheckState
(
Qt
::
Checked
);
}
else
{
qDebug
()
<<
"Editable "
<<
wp
->
getId
()
<<
" changedCurrent: State 0, current false"
;
m_ui
->
selectedBox
->
setChecked
(
false
);
m_ui
->
selectedBox
->
setCheckState
(
Qt
::
Unchecked
);
wp
->
setCurrent
(
false
);
//
wp->setCurrent(false);
}
}
else
{
qDebug
()
<<
"Editable "
<<
wp
->
getId
()
<<
" changedCurrent: State 2"
;
wp
->
setCurrent
(
true
);
//
emit changeCurrentWaypoint(wp->getId()); //the slot changeCurrentWaypoint() in WaypointList sets all other current flags to false
emit
changeCurrentWaypoint
(
wp
->
getId
());
//the slot changeCurrentWaypoint() in WaypointList sets all other current flags to false
}
m_ui
->
selectedBox
->
blockSignals
(
false
);
//
m_ui->selectedBox->blockSignals(false);
}
void
WaypointEditableView
::
updateValues
()
...
...
src/ui/WaypointList.cc
View file @
3805b4cc
...
...
@@ -306,8 +306,12 @@ void WaypointList::changeCurrentWaypoint(quint16 seq)
void
WaypointList
::
currentWaypointEditableChanged
(
quint16
seq
)
{
qDebug
()
<<
"WaypointList::currentWaypointEditableChanged"
;
if
(
uas
)
{
uas
->
getWaypointManager
()
->
setCurrentEditable
(
seq
);
/*
const QVector<Waypoint *> &waypoints = uas->getWaypointManager()->getWaypointEditableList();
if (seq < waypoints.size())
...
...
@@ -326,7 +330,9 @@ void WaypointList::currentWaypointEditableChanged(quint16 seq)
}
}
}
*/
}
}
void
WaypointList
::
currentWaypointViewOnlyChanged
(
quint16
seq
)
...
...
@@ -458,8 +464,8 @@ void WaypointList::waypointEditableListChanged()
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)));
commented, because unused
connect
(
wpview
,
SIGNAL
(
changeCurrentWaypoint
(
quint16
)),
this
,
SLOT
(
c
hangeCurrentWaypointEditable
(
quint16
)));
//connect(wpview, SIGNAL(currentWaypointChanged(quint16)), this, SLOT(currentWaypointChanged(quint16)));
connect
(
wpview
,
SIGNAL
(
changeCurrentWaypoint
(
quint16
)),
this
,
SLOT
(
c
urrentWaypointEditableChanged
(
quint16
)));
editableListLayout
->
insertWidget
(
i
,
wpview
);
}
WaypointEditableView
*
wpv
=
wpEditableViews
.
value
(
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