refs #865, added parts to interpolation log

This commit is contained in:
Klaus Basan
2017-01-27 01:07:39 +01:00
committed by Mathew Sutcliffe
parent cbbab3fa19
commit ff7756db38
3 changed files with 18 additions and 9 deletions

View File

@@ -203,6 +203,7 @@ namespace BlackMisc
QLatin1Literal("<th>elv.old</th><th>elv.new</th><th>elv.cur</th>") %
QLatin1Literal("<th>gnd.factor</th>") %
QLatin1Literal("<th>onGnd.old</th><th>onGnd.new</th><th>onGnd.cur</th>") %
QLatin1Literal("<th>parts</th><th>parts details</th>") %
QLatin1Literal("</tr>\n");
static const CLengthUnit ft = CLengthUnit::ft();
@@ -244,7 +245,11 @@ namespace BlackMisc
QLatin1Literal("<td>") % QString::number(log.groundFactor) % QLatin1Literal("</td>") %
QLatin1Literal("<td class=\"old\">") % log.oldSituation.getOnGroundInfo() % QLatin1Literal("</td>") %
QLatin1Literal("<td class=\"new\">") % log.newSituation.getOnGroundInfo() % QLatin1Literal("</td>") %
QLatin1Literal("<td class=\"cur\">") % log.currentSituation.getOnGroundInfo() % QLatin1Literal("</td>") %
QLatin1Literal("<td class=\"cur\">") % log.currentSituation.getOnGroundInfo() % QLatin1Literal("</td>");
tableRows +=
QLatin1Literal("<td>") % boolToYesNo(log.useParts) % QLatin1Literal("</td>") %
QLatin1Literal("<td>") % (log.useParts ? log.parts.toQString(true) : QLatin1Literal("")) % QLatin1Literal("</td>") %
QLatin1Literal("</tr>\n");
}

View File

@@ -109,9 +109,9 @@ namespace BlackMisc
//! Parts before given offset time (aka pending parts)
//! \threadsafe
virtual BlackMisc::Aviation::CAircraftParts getInterpolatedParts(
const Aviation::CCallsign &callsign,
const BlackMisc::Aviation::CAircraftPartsList &parts, qint64 cutoffTime,
PartsStatus &partsStatus) const;
const Aviation::CCallsign &callsign,
const BlackMisc::Aviation::CAircraftPartsList &parts, qint64 cutoffTime,
PartsStatus &partsStatus) const;
//! Parts before given offset time (aka pending parts)
//! \threadsafe
@@ -149,9 +149,11 @@ namespace BlackMisc
double groundFactor = -1; //!< current ground factor
double vtolAircraft = false; //!< VTOL aircraft
double deltaTimeMs = 0; //!< delta time to last situation
double simulationTimeFraction = -1; //!< time fraction, normally 0..1
double deltaTimeFractionMs = -1; //!< delta time fraction
BlackMisc::Aviation::CCallsign callsign; //!< current callsign
double simulationTimeFraction = -1; //!< time fraction, normally 0..1
double deltaTimeFractionMs = -1; //!< delta time fraction
bool useParts = false; //!< supporting aircraft parts
BlackMisc::Aviation::CCallsign callsign; //!< current callsign
BlackMisc::Aviation::CAircraftParts parts; //!< corresponding parts used in interpolator
BlackMisc::Aviation::CAircraftSituation oldSituation; //!< old situation
BlackMisc::Aviation::CAircraftSituation newSituation; //!< new situation
BlackMisc::Aviation::CAircraftSituation currentSituation; //!< interpolated situation

View File

@@ -107,7 +107,7 @@ namespace BlackMisc
IInterpolator::setGroundElevationFromHint(hints, newSituation);
}
CAircraftSituation currentSituation(oldSituation);
CAircraftSituation currentSituation(oldSituation); // also sets ground elevation if available
CCoordinateGeodetic currentPosition;
// Time between start and end packet
@@ -139,7 +139,8 @@ namespace BlackMisc
currentSituation.setPosition(currentPosition);
// Interpolate altitude: Alt = (AltB - AltA) * t + AltA
const CAltitude oldAlt(oldSituation.getCorrectedAltitude()); // avoid underflow below ground elevation
// avoid underflow below ground elevation by using getCorrectedAltitude
const CAltitude oldAlt(oldSituation.getCorrectedAltitude());
const CAltitude newAlt(newSituation.getCorrectedAltitude());
Q_ASSERT_X(oldAlt.getReferenceDatum() == CAltitude::MeanSeaLevel && oldAlt.getReferenceDatum() == newAlt.getReferenceDatum(), Q_FUNC_INFO, "mismatch in reference"); // otherwise no calculation is possible
currentSituation.setAltitude(CAltitude((newAlt - oldAlt)
@@ -222,6 +223,7 @@ namespace BlackMisc
log.currentSituation = currentSituation;
log.oldSituation = oldSituation;
log.newSituation = newSituation;
log.useParts = hints.hasAircraftParts();
this->logInterpolation(log);
}