GCS PathPlan Editor does not correctly load (from saved file) a path plan that consists of NOT relative to home waypoints

Description

Found an issue with GCS PathPlan Editor when using waypoints NOT relative to home. User can create the plan and save it to file.

When trying to load it from the file, all the loaded waypoints get the same coordinates as current position (Home point?) instead of the saved coordinates and the GCS interface experiences a serious slowdown for a period ot time.

Traced the bug in the GCS code down to: \ground\gcs\src\libs\opmapcontrol\src\mapwidget\opmapwidget.cpp

WayPointItem *OPMapWidget::WPInsert(internals:ointLatLng const & coord, int const & altitude, QString const & description, const int &position)

Suggested fix:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 WayPointItem *OPMapWidget::WPInsert(internals::PointLatLng const & coord, int const & altitude, QString const & description, const int &position) { internals::PointLatLng mcoord; // bool reloc = false; if (coord == internals::PointLatLng(0, 0)) { // changed to "coord" instead of "mcoord" mcoord = CurrentPosition(); // reloc = true; } else { mcoord = coord; } WayPointItem *item = new WayPointItem(mcoord, altitude, description, map); item->SetNumber(position); ConnectWP(item); item->setParentItem(map); emit WPInserted(position, item); // if (reloc) { emit WPValuesChanged(item); // } // Explicitly emit this signal to update DistanceToHome, BearingFromHome, etc. // for imported waypoints (that are not "relative to home"). // I guess this is clean and safe because WPInsert with this params set is only called in // modelMapProxy::rowsInserted for not-relative-to-home waypoints) setOverlayOpacity(overlayOpacity); return item; }

Environment

None

Status

Assignee

Julian Lilov

Reporter

Julian Lilov

Labels

Components

Fix versions

Affects versions

REL-16.09 - Black Rhino

Priority

Medium
Configure