Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/MissionManager/FixedWingLandingComplexItem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,6 @@ void FixedWingLandingComplexItem::_calcGlideSlope(void)
_glideSlopeFact.setRawValue(qRadiansToDegrees(qAtan(landingAltDifference / landingDistance)));
}

void FixedWingLandingComplexItem::moveLandingPosition(const QGeoCoordinate& coordinate)
{
double savedHeading = landingHeading()->rawValue().toDouble();
double savedDistance = landingDistance()->rawValue().toDouble();

setLandingCoordinate(coordinate);
landingHeading()->setRawValue(savedHeading);
landingDistance()->setRawValue(savedDistance);
}

bool FixedWingLandingComplexItem::_isValidLandItem(const MissionItem& missionItem)
{
if (missionItem.command() != MAV_CMD_NAV_LAND ||
Expand Down
2 changes: 0 additions & 2 deletions src/MissionManager/FixedWingLandingComplexItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class FixedWingLandingComplexItem : public LandingComplexItem
Q_PROPERTY(Fact* valueSetIsDistance READ valueSetIsDistance CONSTANT)
Q_PROPERTY(Fact* glideSlope READ glideSlope CONSTANT)

Q_INVOKABLE void moveLandingPosition(const QGeoCoordinate& coordinate); // Maintains the current landing distance and heading

Fact* glideSlope (void) { return &_glideSlopeFact; }
Fact* valueSetIsDistance (void) { return &_valueSetIsDistanceFact; }

Expand Down
13 changes: 13 additions & 0 deletions src/MissionManager/LandingComplexItem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,19 @@ void LandingComplexItem::_setDirty(void)
setDirty(true);
}

void LandingComplexItem::setCoordinate(const QGeoCoordinate& coordinate) {
if (!_landingCoordSet) {
setLandingCoordinate(coordinate);
return;
}

// Move entire complex item, preserving heading and distance
_ignoreRecalcSignals = true;
setLandingCoordinate(coordinate);
_ignoreRecalcSignals = false;
_recalcFromHeadingAndDistanceChange();
}

void LandingComplexItem::setSequenceNumber(int sequenceNumber)
{
if (_sequenceNumber != sequenceNumber) {
Expand Down
2 changes: 1 addition & 1 deletion src/MissionManager/LandingComplexItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class LandingComplexItem : public ComplexMissionItem
ReadyForSaveState readyForSaveState (void) const final;
bool exitCoordinateSameAsEntry (void) const final { return false; }
void setDirty (bool dirty) final;
void setCoordinate (const QGeoCoordinate& coordinate) final { setFinalApproachCoordinate(coordinate); }
void setCoordinate (const QGeoCoordinate& coordinate) final;
void setSequenceNumber (int sequenceNumber) final;
double amslEntryAlt (void) const final;
double amslExitAlt (void) const final;
Expand Down
2 changes: 1 addition & 1 deletion src/QmlControls/FWLandingPatternMapVisual.qml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Item {
itemCoordinate: _missionItem.landingCoordinate
visible: _root.interactive

onItemCoordinateChanged: _missionItem.moveLandingPosition(itemCoordinate)
onItemCoordinateChanged: _missionItem.coordinate = itemCoordinate
}
}

Expand Down
Loading