mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 05:45:35 +08:00
Ref T275, unified elevation missed info -> getElevationsFoundMissedInfo()
This commit is contained in:
@@ -372,12 +372,9 @@ namespace BlackGui
|
|||||||
void CInterpolationLogDisplay::displayElevationRequestReceive()
|
void CInterpolationLogDisplay::displayElevationRequestReceive()
|
||||||
{
|
{
|
||||||
if (!m_airspaceMonitor) { return; }
|
if (!m_airspaceMonitor) { return; }
|
||||||
static const QString rr("%1 / %2 hits %3 / %4 %5%");
|
static const QString info("%1/%2 hits %3");
|
||||||
const QPair<int, int> foundMissed = m_airspaceMonitor->getElevationsFoundMissed();
|
const QString foundMissed = m_airspaceMonitor->getElevationsFoundMissedInfo();
|
||||||
const int f = foundMissed.first;
|
ui->le_ElevationReqRec->setText(info.arg(m_elvRequested).arg(m_elvReceived).arg(foundMissed));
|
||||||
const int m = foundMissed.second;
|
|
||||||
const double hitRatioPercent = 100.0 * static_cast<double>(f) / static_cast<double>(f + m);
|
|
||||||
ui->le_ElevationReqRec->setText(rr.arg(m_elvRequested).arg(m_elvReceived).arg(f).arg(m).arg(QString::number(hitRatioPercent, 'f', 1)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInterpolationLogDisplay::linkWithAirspaceMonitor()
|
void CInterpolationLogDisplay::linkWithAirspaceMonitor()
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ namespace BlackMisc
|
|||||||
) %
|
) %
|
||||||
(
|
(
|
||||||
withElevation ?
|
withElevation ?
|
||||||
QStringLiteral("Elev info.: ") % elevationInfo %
|
QStringLiteral("Elev.info: ") % elevationInfo %
|
||||||
QStringLiteral(" scenery os: ") % sceneryOffset.valueRoundedWithUnit(1) % separator :
|
QStringLiteral(" scenery os: ") % sceneryOffset.valueRoundedWithUnit(1) % separator :
|
||||||
QStringLiteral("")
|
QStringLiteral("")
|
||||||
) %
|
) %
|
||||||
|
|||||||
@@ -224,8 +224,6 @@ namespace BlackMisc
|
|||||||
// logging
|
// logging
|
||||||
if (this->doLogging())
|
if (this->doLogging())
|
||||||
{
|
{
|
||||||
static const QString elv("found %1 missed %2");
|
|
||||||
const QPair<int, int> elvStats = this->getElevationsFoundMissed();
|
|
||||||
log.tsCurrent = m_currentTimeMsSinceEpoch;
|
log.tsCurrent = m_currentTimeMsSinceEpoch;
|
||||||
log.callsign = m_callsign;
|
log.callsign = m_callsign;
|
||||||
log.groundFactor = currentSituation.getOnGroundFactor();
|
log.groundFactor = currentSituation.getOnGroundFactor();
|
||||||
@@ -233,7 +231,7 @@ namespace BlackMisc
|
|||||||
log.situationCurrent = currentSituation;
|
log.situationCurrent = currentSituation;
|
||||||
log.change = m_pastSituationsChange;
|
log.change = m_pastSituationsChange;
|
||||||
log.usedSetup = m_currentSetup;
|
log.usedSetup = m_currentSetup;
|
||||||
log.elevationInfo = elv.arg(elvStats.first).arg(elvStats.second);
|
log.elevationInfo = this->getElevationsFoundMissedInfo();
|
||||||
log.cgAboveGround = currentSituation.getCG();
|
log.cgAboveGround = currentSituation.getCG();
|
||||||
log.sceneryOffset = m_currentSceneryOffset;
|
log.sceneryOffset = m_currentSceneryOffset;
|
||||||
m_logger->logInterpolation(log);
|
m_logger->logInterpolation(log);
|
||||||
|
|||||||
@@ -141,6 +141,16 @@ namespace BlackMisc
|
|||||||
return QPair<int, int>(m_elvFound, m_elvMissed);
|
return QPair<int, int>(m_elvFound, m_elvMissed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ISimulationEnvironmentProvider::getElevationsFoundMissedInfo() const
|
||||||
|
{
|
||||||
|
static const QString info("%1/%2 %3");
|
||||||
|
const QPair<int, int> foundMissed = this->getElevationsFoundMissed();
|
||||||
|
const int f = foundMissed.first;
|
||||||
|
const int m = foundMissed.second;
|
||||||
|
const double hitRatioPercent = 100.0 * static_cast<double>(f) / static_cast<double>(f + m);
|
||||||
|
return info.arg(f).arg(m).arg(QString::number(hitRatioPercent, 'f', 1));
|
||||||
|
}
|
||||||
|
|
||||||
CSimulatorPluginInfo ISimulationEnvironmentProvider::getSimulatorPluginInfo() const
|
CSimulatorPluginInfo ISimulationEnvironmentProvider::getSimulatorPluginInfo() const
|
||||||
{
|
{
|
||||||
QReadLocker l(&m_lockModel);
|
QReadLocker l(&m_lockModel);
|
||||||
@@ -258,6 +268,12 @@ namespace BlackMisc
|
|||||||
return this->provider()->getElevationsFoundMissed();
|
return this->provider()->getElevationsFoundMissed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CSimulationEnvironmentAware::getElevationsFoundMissedInfo() const
|
||||||
|
{
|
||||||
|
if (!this->hasProvider()) { return QString(); }
|
||||||
|
return this->provider()->getElevationsFoundMissedInfo();
|
||||||
|
}
|
||||||
|
|
||||||
CSimulatorPluginInfo CSimulationEnvironmentAware::getSimulatorPluginInfo() const
|
CSimulatorPluginInfo CSimulationEnvironmentAware::getSimulatorPluginInfo() const
|
||||||
{
|
{
|
||||||
if (!this->hasProvider()) { return CSimulatorPluginInfo(); }
|
if (!this->hasProvider()) { return CSimulatorPluginInfo(); }
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ namespace BlackMisc
|
|||||||
//! \threadsafe
|
//! \threadsafe
|
||||||
QPair<int, int> getElevationsFoundMissed() const;
|
QPair<int, int> getElevationsFoundMissed() const;
|
||||||
|
|
||||||
|
//! Elevations found/missed statistics info as string
|
||||||
|
//! \threadsafe
|
||||||
|
QString getElevationsFoundMissedInfo() const;
|
||||||
|
|
||||||
//! Get the represented plugin
|
//! Get the represented plugin
|
||||||
//! \threadsafe
|
//! \threadsafe
|
||||||
CSimulatorPluginInfo getSimulatorPluginInfo() const;
|
CSimulatorPluginInfo getSimulatorPluginInfo() const;
|
||||||
@@ -88,7 +92,7 @@ namespace BlackMisc
|
|||||||
//! Ctor
|
//! Ctor
|
||||||
ISimulationEnvironmentProvider(const CSimulatorPluginInfo &pluginInfo);
|
ISimulationEnvironmentProvider(const CSimulatorPluginInfo &pluginInfo);
|
||||||
|
|
||||||
//! All remembered coordiantes plus max remembered situations
|
//! All remembered coordiantes plus max.remembered situations
|
||||||
//! \threadsafe
|
//! \threadsafe
|
||||||
Geo::CCoordinateGeodeticList getElevationCoordinates(int &maxRemembered) const;
|
Geo::CCoordinateGeodeticList getElevationCoordinates(int &maxRemembered) const;
|
||||||
|
|
||||||
@@ -172,6 +176,9 @@ namespace BlackMisc
|
|||||||
//! \copydoc ISimulationEnvironmentProvider::getElevationsFoundMissed
|
//! \copydoc ISimulationEnvironmentProvider::getElevationsFoundMissed
|
||||||
QPair<int, int> getElevationsFoundMissed() const;
|
QPair<int, int> getElevationsFoundMissed() const;
|
||||||
|
|
||||||
|
//! \copydoc ISimulationEnvironmentProvider::getElevationsFoundMissedInfo
|
||||||
|
QString getElevationsFoundMissedInfo() const;
|
||||||
|
|
||||||
//! \copydoc ISimulationEnvironmentProvider::getSimulatorPluginInfo
|
//! \copydoc ISimulationEnvironmentProvider::getSimulatorPluginInfo
|
||||||
CSimulatorPluginInfo getSimulatorPluginInfo() const;
|
CSimulatorPluginInfo getSimulatorPluginInfo() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user