Commit dee30f13 authored by DonLakeFlyer's avatar DonLakeFlyer

Change in vehicle speed requires transect rebuild to recalc terrain max climb/descent rate based setup
parent d307ae7f
......@@ -327,8 +327,10 @@ double TransectStyleComplexItem::greatestDistanceTo(const QGeoCoordinate &other)
void TransectStyleComplexItem::setMissionFlightStatus(MissionController::MissionFlightStatus_t& missionFlightStatus)
{
ComplexMissionItem::setMissionFlightStatus(missionFlightStatus);
if (!qFuzzyCompare(_cruiseSpeed, missionFlightStatus.vehicleSpeed)) {
_cruiseSpeed = missionFlightStatus.vehicleSpeed;
if (!qFuzzyCompare(_vehicleSpeed, missionFlightStatus.vehicleSpeed)) {
_vehicleSpeed = missionFlightStatus.vehicleSpeed;
// Vehicle speed change affects max climb/descent rates calcs for terrain so we need to re-adjust
_rebuildTransects();
emit timeBetweenShotsChanged();
}
}
......@@ -707,9 +709,9 @@ int TransectStyleComplexItem::_maxPathHeight(const TerrainPathQuery::PathHeightI
void TransectStyleComplexItem::_adjustForMaxRates(QList<CoordInfo_t>& transect)
{
double maxClimbRate = _terrainAdjustMaxClimbRateFact.rawValue().toDouble();
double maxDescentRate = _terrainAdjustMaxDescentRateFact.rawValue().toDouble();
double flightSpeed = _missionFlightStatus.vehicleSpeed;
double maxClimbRate = _terrainAdjustMaxClimbRateFact.rawValue().toDouble();
double maxDescentRate = _terrainAdjustMaxDescentRateFact.rawValue().toDouble();
double flightSpeed = _vehicleSpeed;
if (qIsNaN(flightSpeed) || (maxClimbRate == 0 && maxDescentRate == 0)) {
if (qIsNaN(flightSpeed)) {
......
......@@ -185,7 +185,7 @@ protected:
double _complexDistance = qQNaN();
int _cameraShots = 0;
double _timeBetweenShots = 0;
double _cruiseSpeed = 0;
double _vehicleSpeed = 5;
CameraCalc _cameraCalc;
bool _followTerrain = false;
double _minAMSLAltitude = qQNaN();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment