mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 05:45:35 +08:00
refs #865, added parts to interpolation log
This commit is contained in:
committed by
Mathew Sutcliffe
parent
cbbab3fa19
commit
ff7756db38
@@ -203,6 +203,7 @@ namespace BlackMisc
|
|||||||
QLatin1Literal("<th>elv.old</th><th>elv.new</th><th>elv.cur</th>") %
|
QLatin1Literal("<th>elv.old</th><th>elv.new</th><th>elv.cur</th>") %
|
||||||
QLatin1Literal("<th>gnd.factor</th>") %
|
QLatin1Literal("<th>gnd.factor</th>") %
|
||||||
QLatin1Literal("<th>onGnd.old</th><th>onGnd.new</th><th>onGnd.cur</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");
|
QLatin1Literal("</tr>\n");
|
||||||
|
|
||||||
static const CLengthUnit ft = CLengthUnit::ft();
|
static const CLengthUnit ft = CLengthUnit::ft();
|
||||||
@@ -244,7 +245,11 @@ namespace BlackMisc
|
|||||||
QLatin1Literal("<td>") % QString::number(log.groundFactor) % QLatin1Literal("</td>") %
|
QLatin1Literal("<td>") % QString::number(log.groundFactor) % QLatin1Literal("</td>") %
|
||||||
QLatin1Literal("<td class=\"old\">") % log.oldSituation.getOnGroundInfo() % QLatin1Literal("</td>") %
|
QLatin1Literal("<td class=\"old\">") % log.oldSituation.getOnGroundInfo() % QLatin1Literal("</td>") %
|
||||||
QLatin1Literal("<td class=\"new\">") % log.newSituation.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");
|
QLatin1Literal("</tr>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,9 @@ namespace BlackMisc
|
|||||||
double deltaTimeMs = 0; //!< delta time to last situation
|
double deltaTimeMs = 0; //!< delta time to last situation
|
||||||
double simulationTimeFraction = -1; //!< time fraction, normally 0..1
|
double simulationTimeFraction = -1; //!< time fraction, normally 0..1
|
||||||
double deltaTimeFractionMs = -1; //!< delta time fraction
|
double deltaTimeFractionMs = -1; //!< delta time fraction
|
||||||
|
bool useParts = false; //!< supporting aircraft parts
|
||||||
BlackMisc::Aviation::CCallsign callsign; //!< current callsign
|
BlackMisc::Aviation::CCallsign callsign; //!< current callsign
|
||||||
|
BlackMisc::Aviation::CAircraftParts parts; //!< corresponding parts used in interpolator
|
||||||
BlackMisc::Aviation::CAircraftSituation oldSituation; //!< old situation
|
BlackMisc::Aviation::CAircraftSituation oldSituation; //!< old situation
|
||||||
BlackMisc::Aviation::CAircraftSituation newSituation; //!< new situation
|
BlackMisc::Aviation::CAircraftSituation newSituation; //!< new situation
|
||||||
BlackMisc::Aviation::CAircraftSituation currentSituation; //!< interpolated situation
|
BlackMisc::Aviation::CAircraftSituation currentSituation; //!< interpolated situation
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ namespace BlackMisc
|
|||||||
IInterpolator::setGroundElevationFromHint(hints, newSituation);
|
IInterpolator::setGroundElevationFromHint(hints, newSituation);
|
||||||
}
|
}
|
||||||
|
|
||||||
CAircraftSituation currentSituation(oldSituation);
|
CAircraftSituation currentSituation(oldSituation); // also sets ground elevation if available
|
||||||
CCoordinateGeodetic currentPosition;
|
CCoordinateGeodetic currentPosition;
|
||||||
|
|
||||||
// Time between start and end packet
|
// Time between start and end packet
|
||||||
@@ -139,7 +139,8 @@ namespace BlackMisc
|
|||||||
currentSituation.setPosition(currentPosition);
|
currentSituation.setPosition(currentPosition);
|
||||||
|
|
||||||
// Interpolate altitude: Alt = (AltB - AltA) * t + AltA
|
// 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());
|
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
|
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)
|
currentSituation.setAltitude(CAltitude((newAlt - oldAlt)
|
||||||
@@ -222,6 +223,7 @@ namespace BlackMisc
|
|||||||
log.currentSituation = currentSituation;
|
log.currentSituation = currentSituation;
|
||||||
log.oldSituation = oldSituation;
|
log.oldSituation = oldSituation;
|
||||||
log.newSituation = newSituation;
|
log.newSituation = newSituation;
|
||||||
|
log.useParts = hints.hasAircraftParts();
|
||||||
this->logInterpolation(log);
|
this->logInterpolation(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user