Ref T231, Ref T236, Ref T238 improved logging "toQString" of hints/setup improved

This commit is contained in:
Klaus Basan
2018-01-29 04:42:28 +01:00
parent 27fb57ca39
commit 39533a7508
2 changed files with 24 additions and 21 deletions

View File

@@ -14,6 +14,8 @@ using namespace BlackMisc::Aviation;
using namespace BlackMisc::Geo; using namespace BlackMisc::Geo;
using namespace BlackMisc::PhysicalQuantities; using namespace BlackMisc::PhysicalQuantities;
#include <QStringBuilder>
namespace BlackMisc namespace BlackMisc
{ {
namespace Simulation namespace Simulation
@@ -79,14 +81,10 @@ namespace BlackMisc
const ColumnIndex i = index.frontCasted<ColumnIndex>(); const ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i) switch (i)
{ {
case IndexCenterOfGravity: case IndexCenterOfGravity: return this->m_cgAboveGround.propertyByIndex(index.copyFrontRemoved());
return this->m_cgAboveGround.propertyByIndex(index.copyFrontRemoved()); case IndexElevationPlane: return this->m_elevationPlane.propertyByIndex(index.copyFrontRemoved());
case IndexElevationPlane: case IndexIsVtolAircraft: return CVariant::fromValue(m_isVtol);
return this->m_elevationPlane.propertyByIndex(index.copyFrontRemoved()); default: return CValueObject::propertyByIndex(index);
case IndexIsVtolAircraft:
return CVariant::fromValue(m_isVtol);
default:
return CValueObject::propertyByIndex(index);
} }
} }
@@ -113,8 +111,17 @@ namespace BlackMisc
QString CInterpolationHints::convertToQString(bool i18n) const QString CInterpolationHints::convertToQString(bool i18n) const
{ {
static const QString s("%1 %2"); return
return s.arg(m_elevationPlane.toQString(i18n), m_cgAboveGround.toQString(i18n)); 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 QString CInterpolationHints::debugInfo(const Geo::CElevationPlane &deltaElevation) const

View File

@@ -9,6 +9,7 @@
#include "interpolationrenderingsetup.h" #include "interpolationrenderingsetup.h"
#include "stringutils.h" #include "stringutils.h"
#include <QStringBuilder>
using namespace BlackMisc::Aviation; using namespace BlackMisc::Aviation;
using namespace BlackMisc::PhysicalQuantities; using namespace BlackMisc::PhysicalQuantities;
@@ -165,17 +166,12 @@ namespace BlackMisc
QString CInterpolationAndRenderingSetup::convertToQString(bool i18n) const QString CInterpolationAndRenderingSetup::convertToQString(bool i18n) const
{ {
Q_UNUSED(i18n); Q_UNUSED(i18n);
QString s("Setup: debug sim: "); return
s += boolToYesNo(m_simulatorDebugMessages); QStringLiteral("Debug sim: ") % boolToYesNo(m_simulatorDebugMessages) %
s += " debug interpolator: "; QStringLiteral(" debug interpolator: ") % boolToYesNo(m_interpolatorDebugMessage) %
s += boolToYesNo(m_interpolatorDebugMessage); QStringLiteral(" force full interpolation: ") % boolToYesNo(m_forceFullInterpolation) %
s += " force full interpolation: "; QStringLiteral(" max.aircraft:") % QString::number(m_maxRenderedAircraft) %
s += boolToYesNo(m_forceFullInterpolation); QStringLiteral(" max.distance:") % m_maxRenderedDistance.valueRoundedWithUnit(CLengthUnit::NM(), 2);
s += " max.aircraft:";
s += QString::number(m_maxRenderedAircraft);
s += " max.distance:";
s += m_maxRenderedDistance.valueRoundedWithUnit(CLengthUnit::NM(), 2);
return s;
} }
CVariant CInterpolationAndRenderingSetup::propertyByIndex(const BlackMisc::CPropertyIndex &index) const CVariant CInterpolationAndRenderingSetup::propertyByIndex(const BlackMisc::CPropertyIndex &index) const