Browse Source

Fix up waypoint handling to not flicker on current WP change state

QGC4.4
Lorenz Meier 11 years ago
parent
commit
aa7b4b459e
  1. 3
      src/Waypoint.cc
  2. 2
      src/uas/UASWaypointManager.cc
  3. 17
      src/ui/WaypointEditableView.cc

3
src/Waypoint.cc

@ -216,7 +216,8 @@ void Waypoint::setCurrent(bool current) @@ -216,7 +216,8 @@ void Waypoint::setCurrent(bool current)
if (this->current != current)
{
this->current = current;
emit changed(this);
// The current waypoint index is handled by the list
// and not part of the individual waypoint update state
}
}

2
src/uas/UASWaypointManager.cc

@ -347,7 +347,7 @@ int UASWaypointManager::setCurrentEditable(quint16 seq) @@ -347,7 +347,7 @@ int UASWaypointManager::setCurrentEditable(quint16 seq)
if (seq < waypointsEditable.count()) {
if(current_state == WP_IDLE) {
//update local main storage
for(int i = 0; i < waypointsEditable.count(); i++) {
for (int i = 0; i < waypointsEditable.count(); i++) {
if (waypointsEditable[i]->getId() == seq) {
waypointsEditable[i]->setCurrent(true);
} else {

17
src/ui/WaypointEditableView.cc

@ -369,7 +369,10 @@ void WaypointEditableView::changedCurrent(int state) @@ -369,7 +369,10 @@ void WaypointEditableView::changedCurrent(int state)
else
{
wp->setCurrent(true);
emit changeCurrentWaypoint(wp->getId()); //the slot changeCurrentWaypoint() in WaypointList sets all other current flags to false
// At this point we do not consider this signal
// to be valid / the edit check boxes should not change the view state
//emit changeCurrentWaypoint(wp->getId());
//the slot changeCurrentWaypoint() in WaypointList sets all other current flags to false
}
}
@ -485,7 +488,10 @@ void WaypointEditableView::updateValues() @@ -485,7 +488,10 @@ void WaypointEditableView::updateValues()
if (m_ui->selectedBox->isChecked() != wp->getCurrent())
{
// This is never a reason to emit a changed signal
m_ui->selectedBox->blockSignals(true);
m_ui->selectedBox->setChecked(wp->getCurrent());
m_ui->selectedBox->blockSignals(false);
}
if (m_ui->autoContinue->isChecked() != wp->getAutoContinue())
{
@ -578,9 +584,12 @@ void WaypointEditableView::updateValues() @@ -578,9 +584,12 @@ void WaypointEditableView::updateValues()
void WaypointEditableView::setCurrent(bool state)
{
m_ui->selectedBox->blockSignals(true);
m_ui->selectedBox->setChecked(state);
m_ui->selectedBox->blockSignals(false);
if (m_ui->selectedBox->isChecked() != state)
{
m_ui->selectedBox->blockSignals(true);
m_ui->selectedBox->setChecked(state);
m_ui->selectedBox->blockSignals(false);
}
}

Loading…
Cancel
Save