mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T241, hint asString function (less info, shorter message)
This commit is contained in:
@@ -143,17 +143,27 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
QString CInterpolationHints::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
return this->asString(true, true);
|
||||
}
|
||||
|
||||
QString CInterpolationHints::asString(bool withParts, bool withElevationPlane) const
|
||||
{
|
||||
return
|
||||
QStringLiteral("VTOL: ") % boolToYesNo(m_isVtol) %
|
||||
QStringLiteral(" parts: ") % boolToYesNo(m_hasParts) %
|
||||
(
|
||||
m_hasParts ?
|
||||
QStringLiteral(" parts: ") % m_aircraftParts.toQString(i18n) :
|
||||
withParts && m_hasParts ?
|
||||
QStringLiteral(" parts: ") % m_aircraftParts.toQString(true) :
|
||||
QStringLiteral("")
|
||||
) %
|
||||
QStringLiteral(" CG: ") % m_cgAboveGround.valueRoundedWithUnit(CLengthUnit::m(), 1) %
|
||||
QStringLiteral(" elv.plane: ") % m_elevationPlane.toQString(i18n) %
|
||||
(
|
||||
withElevationPlane ?
|
||||
QStringLiteral(" elv.plane: ") % m_elevationPlane.toQString(true) :
|
||||
QStringLiteral(" elv.plane: ") % boolToNullNotNull(m_elevationPlane.isNull())
|
||||
) %
|
||||
QStringLiteral(" elv.pr.: ") % boolToYesNo(m_elevationProvider ? true : false);
|
||||
}
|
||||
|
||||
|
||||
@@ -127,6 +127,9 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! Formatted as string
|
||||
QString asString(bool withParts, bool withElevationPlane) const;
|
||||
|
||||
//! For debugging
|
||||
QString debugInfo(const Geo::CElevationPlane &deltaElevation) const;
|
||||
|
||||
|
||||
@@ -421,7 +421,7 @@ namespace BlackMisc
|
||||
QStringLiteral(" | #nw.sit.: ") % QString::number(noNetworkSituations) %
|
||||
(
|
||||
withHints ?
|
||||
separator % QStringLiteral("hints: ") % usedHints.toQString(true) :
|
||||
separator % QStringLiteral("hints: ") % usedHints.asString(false, true) :
|
||||
QStringLiteral("")
|
||||
) %
|
||||
(
|
||||
|
||||
@@ -167,8 +167,8 @@ namespace BlackMisc
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
return
|
||||
QStringLiteral("Debug sim: ") % boolToYesNo(m_simulatorDebugMessages) %
|
||||
QStringLiteral(" debug interpolator: ") % boolToYesNo(m_interpolatorDebugMessage) %
|
||||
QStringLiteral("Dbg.sim.msgs: ") % boolToYesNo(m_simulatorDebugMessages) %
|
||||
QStringLiteral(" dbg.inter.msgs.: ") % boolToYesNo(m_interpolatorDebugMessages) %
|
||||
QStringLiteral(" force full interpolation: ") % boolToYesNo(m_forceFullInterpolation) %
|
||||
QStringLiteral(" max.aircraft:") % QString::number(m_maxRenderedAircraft) %
|
||||
QStringLiteral(" max.distance:") % m_maxRenderedDistance.valueRoundedWithUnit(CLengthUnit::NM(), 2);
|
||||
@@ -180,7 +180,7 @@ namespace BlackMisc
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexInterpolatorDebugMessages: return CVariant::fromValue(m_interpolatorDebugMessage);
|
||||
case IndexInterpolatorDebugMessages: return CVariant::fromValue(m_interpolatorDebugMessages);
|
||||
case IndexSimulatorDebugMessages: return CVariant::fromValue(m_simulatorDebugMessages);
|
||||
case IndexForceFullInterpolation: return CVariant::fromValue(m_forceFullInterpolation);
|
||||
case IndexMaxRenderedAircraft: return CVariant::fromValue(m_maxRenderedAircraft);
|
||||
@@ -200,7 +200,7 @@ namespace BlackMisc
|
||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexInterpolatorDebugMessages: m_interpolatorDebugMessage = variant.toBool(); break;
|
||||
case IndexInterpolatorDebugMessages: m_interpolatorDebugMessages = variant.toBool(); break;
|
||||
case IndexSimulatorDebugMessages: m_simulatorDebugMessages = variant.toBool(); break;
|
||||
case IndexForceFullInterpolation: m_forceFullInterpolation = variant.toBool(); break;
|
||||
case IndexMaxRenderedAircraft: m_maxRenderedAircraft = variant.toInt(); break;
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace BlackMisc
|
||||
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
||||
|
||||
private:
|
||||
bool m_interpolatorDebugMessage = false; //! Debug messages in interpolator
|
||||
bool m_interpolatorDebugMessages = false; //! Debug messages in interpolator
|
||||
bool m_simulatorDebugMessages = false; //! Debug messages of simulator (aka plugin)
|
||||
bool m_forceFullInterpolation = false; //! always do a full interpolation, even if aircraft is not moving
|
||||
bool m_enabledAircraftParts = true; //! Update aircraft parts
|
||||
@@ -136,7 +136,7 @@ namespace BlackMisc
|
||||
|
||||
BLACK_METACLASS(
|
||||
CInterpolationAndRenderingSetup,
|
||||
BLACK_METAMEMBER(interpolatorDebugMessage),
|
||||
BLACK_METAMEMBER(interpolatorDebugMessages),
|
||||
BLACK_METAMEMBER(simulatorDebugMessages),
|
||||
BLACK_METAMEMBER(forceFullInterpolation),
|
||||
BLACK_METAMEMBER(enabledAircraftParts),
|
||||
|
||||
Reference in New Issue
Block a user