diff --git a/src/uas/UASWaypointManager.cc b/src/uas/UASWaypointManager.cc index fc48a3bbdee1a522673a6686b49080c9de05edc8..6202798cc3168ed9383a2e3552414839f85d4407 100644 --- a/src/uas/UASWaypointManager.cc +++ b/src/uas/UASWaypointManager.cc @@ -225,6 +225,17 @@ void UASWaypointManager::handleWaypointAck(quint8 systemId, quint8 compId, mavli current_state = WP_IDLE; readWaypoints(false); //Update "Onboard Waypoints"-tab immidiately after the waypoint list has been sent. emit updateStatusString("done."); + } else if((current_state == WP_SENDLIST || current_state == WP_SENDLIST_SENDWPS) && wpa->type != 0) { + //give up transmitting if a WP is rejected + if (wpa->type == 1) { + emit updateStatusString("upload failed: general error"); + } else if (wpa->type == 2) { + emit updateStatusString("upload failed: coordinate frame unsupported."); + } else { + emit updateStatusString("upload failed: other error."); + } + protocol_timer.stop(); + current_state = WP_IDLE; } else if(current_state == WP_CLEARLIST) { protocol_timer.stop(); current_state = WP_IDLE; @@ -905,7 +916,7 @@ void UASWaypointManager::writeWaypoints() sendWaypointCount(); } else if (waypointsEditable.count() == 0) { - sendWaypointClearAll(); + clearWaypointList(); } } else diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index 673cfd1245a8aaf0a9c5ae8053f49dc1d346ede0..5d31b7fa17e0fce3ed5d2a3871821330e009b0e7 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -283,9 +283,9 @@ void WaypointList::addEditable(bool onCurrentPosition) wp->setZ(last->getZ()); } wp->setParam1(last->getParam1()); - wp->setParam1(last->getParam2()); - wp->setParam1(last->getParam3()); - wp->setParam1(last->getParam4()); + wp->setParam2(last->getParam2()); + wp->setParam3(last->getParam3()); + wp->setParam4(last->getParam4()); wp->setAutocontinue(last->getAutoContinue()); // wp->blockSignals(false); wp->setAction(last->getAction());