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::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

View File

@@ -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