mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Ref T231, Ref T236, Ref T238 improved logging "toQString" of hints/setup improved
This commit is contained in:
@@ -14,6 +14,8 @@ using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
#include <QStringBuilder>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
@@ -79,14 +81,10 @@ namespace BlackMisc
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexCenterOfGravity:
|
||||
return this->m_cgAboveGround.propertyByIndex(index.copyFrontRemoved());
|
||||
case IndexElevationPlane:
|
||||
return this->m_elevationPlane.propertyByIndex(index.copyFrontRemoved());
|
||||
case IndexIsVtolAircraft:
|
||||
return CVariant::fromValue(m_isVtol);
|
||||
default:
|
||||
return CValueObject::propertyByIndex(index);
|
||||
case IndexCenterOfGravity: return this->m_cgAboveGround.propertyByIndex(index.copyFrontRemoved());
|
||||
case IndexElevationPlane: return this->m_elevationPlane.propertyByIndex(index.copyFrontRemoved());
|
||||
case IndexIsVtolAircraft: return CVariant::fromValue(m_isVtol);
|
||||
default: return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,8 +111,17 @@ namespace BlackMisc
|
||||
|
||||
QString CInterpolationHints::convertToQString(bool i18n) const
|
||||
{
|
||||
static const QString s("%1 %2");
|
||||
return s.arg(m_elevationPlane.toQString(i18n), m_cgAboveGround.toQString(i18n));
|
||||
return
|
||||
QStringLiteral("VTOL: ") % boolToYesNo(m_isVtol) %
|
||||
QStringLiteral(" parts: ") % boolToYesNo(m_hasParts) %
|
||||
(
|
||||
m_hasParts ?
|
||||
QStringLiteral(" parts: ") % m_aircraftParts.toQString(i18n) :
|
||||
QStringLiteral("")
|
||||
) %
|
||||
QStringLiteral(" CG: ") % m_cgAboveGround.valueRoundedWithUnit(CLengthUnit::m(), 1) %
|
||||
QStringLiteral(" elv.plane: ") % m_elevationPlane.toQString(i18n) %
|
||||
QStringLiteral(" elv.pr: ") % boolToYesNo(m_elevationProvider ? true : false);
|
||||
}
|
||||
|
||||
QString CInterpolationHints::debugInfo(const Geo::CElevationPlane &deltaElevation) const
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "interpolationrenderingsetup.h"
|
||||
#include "stringutils.h"
|
||||
#include <QStringBuilder>
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
@@ -165,17 +166,12 @@ namespace BlackMisc
|
||||
QString CInterpolationAndRenderingSetup::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
QString s("Setup: debug sim: ");
|
||||
s += boolToYesNo(m_simulatorDebugMessages);
|
||||
s += " debug interpolator: ";
|
||||
s += boolToYesNo(m_interpolatorDebugMessage);
|
||||
s += " force full interpolation: ";
|
||||
s += boolToYesNo(m_forceFullInterpolation);
|
||||
s += " max.aircraft:";
|
||||
s += QString::number(m_maxRenderedAircraft);
|
||||
s += " max.distance:";
|
||||
s += m_maxRenderedDistance.valueRoundedWithUnit(CLengthUnit::NM(), 2);
|
||||
return s;
|
||||
return
|
||||
QStringLiteral("Debug sim: ") % boolToYesNo(m_simulatorDebugMessages) %
|
||||
QStringLiteral(" debug interpolator: ") % boolToYesNo(m_interpolatorDebugMessage) %
|
||||
QStringLiteral(" force full interpolation: ") % boolToYesNo(m_forceFullInterpolation) %
|
||||
QStringLiteral(" max.aircraft:") % QString::number(m_maxRenderedAircraft) %
|
||||
QStringLiteral(" max.distance:") % m_maxRenderedDistance.valueRoundedWithUnit(CLengthUnit::NM(), 2);
|
||||
}
|
||||
|
||||
CVariant CInterpolationAndRenderingSetup::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
|
||||
Reference in New Issue
Block a user