Browse Source

Fix waypoint linkage to first item

QGC4.4
DoinLakeFlyer 5 years ago
parent
commit
8429cf6a3b
  1. 6
      src/MissionManager/MissionController.cc

6
src/MissionManager/MissionController.cc

@ -1308,11 +1308,12 @@ void MissionController::_recalcWaypointLines(void)
startVIForIncompleteItem = visualItem; startVIForIncompleteItem = visualItem;
} }
if (i != 1 && (lastCoordinateItemBeforeRTL != _settingsItem || (homePositionValid && linkStartToHome))) { if (lastCoordinateItemBeforeRTL != _settingsItem || (homePositionValid && linkStartToHome)) {
bool addDirectionArrow = false;
if (i != 1) {
// Direction arrows are added to the second segment and every 5 segments thereafter. // Direction arrows are added to the second segment and every 5 segments thereafter.
// The reason for start with second segment is to prevent an arrow being added in between the home position // The reason for start with second segment is to prevent an arrow being added in between the home position
// and a takeoff item which may be right over each other. In that case the arrow points in a random direction. // and a takeoff item which may be right over each other. In that case the arrow points in a random direction.
bool addDirectionArrow = false;
if (firstCoordinateNotFound || !lastCoordinateItemBeforeRTL->isSimpleItem() || !visualItem->isSimpleItem()) { if (firstCoordinateNotFound || !lastCoordinateItemBeforeRTL->isSimpleItem() || !visualItem->isSimpleItem()) {
addDirectionArrow = true; addDirectionArrow = true;
} else if (segmentCount > 5) { } else if (segmentCount > 5) {
@ -1320,6 +1321,7 @@ void MissionController::_recalcWaypointLines(void)
addDirectionArrow = true; addDirectionArrow = true;
} }
segmentCount++; segmentCount++;
}
lastSegmentVisualItemPair = VisualItemPair(lastCoordinateItemBeforeRTL, visualItem); lastSegmentVisualItemPair = VisualItemPair(lastCoordinateItemBeforeRTL, visualItem);
if (!_flyView || addDirectionArrow) { if (!_flyView || addDirectionArrow) {

Loading…
Cancel
Save