Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
3805b4cc
Commit
3805b4cc
authored
Oct 05, 2011
by
pixhawk
Browse files
Fixed changing "current" bugs. Should now work as intended.
parent
c3ff739f
Changes
3
Hide whitespace changes
Inline
Side-by-side
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
hangeC
urrentWaypointEditable
(
quint16
)));
//connect(wpview, SIGNAL(currentWaypointChanged(quint16)), this, SLOT(currentWaypointChanged(quint16)));
connect
(
wpview
,
SIGNAL
(
changeCurrentWaypoint
(
quint16
)),
this
,
SLOT
(
currentWaypointEditable
Changed
(
quint16
)));
editableListLayout
->
insertWidget
(
i
,
wpview
);
}
WaypointEditableView
*
wpv
=
wpEditableViews
.
value
(
wp
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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