mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
Ref T480 No need for QStringLiteral when concatenating with %, use UTF-16 string literals.
This commit is contained in:
@@ -75,7 +75,7 @@ namespace BlackMisc
|
||||
QString CAircraftIcaoCode::getDesignatorDbKey() const
|
||||
{
|
||||
return (this->isLoadedFromDb()) ?
|
||||
this->getDesignator() % QStringLiteral(" ") % this->getDbKeyAsStringInParentheses() :
|
||||
this->getDesignator() % u' ' % this->getDbKeyAsStringInParentheses() :
|
||||
this->getDesignator();
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ namespace BlackMisc
|
||||
QString CAircraftIcaoCode::getDesignatorManufacturer() const
|
||||
{
|
||||
return (this->hasDesignator() ? this->getDesignator() : QStringLiteral("????")) %
|
||||
(this->hasManufacturer() ? (QStringLiteral(" ") % this->getManufacturer()) : QString());
|
||||
(this->hasManufacturer() ? (u' ' % this->getManufacturer()) : QString());
|
||||
}
|
||||
|
||||
bool CAircraftIcaoCode::hasManufacturer() const
|
||||
@@ -478,28 +478,28 @@ namespace BlackMisc
|
||||
QString CAircraftIcaoCode::getCombinedIcaoStringWithKey() const
|
||||
{
|
||||
return (this->hasDesignator() ? this->getDesignator() : QStringLiteral("????")) %
|
||||
(this->hasManufacturer() ? (QStringLiteral(" ") % this->getManufacturer()) : QString()) %
|
||||
(this->hasModelDescription() ? (QStringLiteral(" ") % this->getModelDescription()) : QString()) %
|
||||
(this->hasManufacturer() ? (u' ' % this->getManufacturer()) : QString()) %
|
||||
(this->hasModelDescription() ? (u' ' % this->getModelDescription()) : QString()) %
|
||||
this->getDbKeyAsStringInParentheses(" ");
|
||||
}
|
||||
|
||||
QString CAircraftIcaoCode::getCombinedIataStringWithKey() const
|
||||
{
|
||||
if (!this->hasIataCode()) { return ""; }
|
||||
return this->getIataCode() % QStringLiteral(" [IATA") %
|
||||
(this->hasDesignator() ? (QStringLiteral(" ") % this->getDesignator()) : QString()) %
|
||||
(this->hasManufacturer() ? (QStringLiteral(" ") % this->getManufacturer()) : QString()) %
|
||||
(this->hasModelDescription() ? (QStringLiteral(" ") % this->getModelDescription()) : QString()) %
|
||||
return this->getIataCode() % u" [IATA" %
|
||||
(this->hasDesignator() ? (u' ' % this->getDesignator()) : QString()) %
|
||||
(this->hasManufacturer() ? (u' ' % this->getManufacturer()) : QString()) %
|
||||
(this->hasModelDescription() ? (u' ' % this->getModelDescription()) : QString()) %
|
||||
this->getDbKeyAsStringInParentheses(" ");
|
||||
}
|
||||
|
||||
QString CAircraftIcaoCode::getCombinedFamilyStringWithKey() const
|
||||
{
|
||||
if (!this->hasFamily()) { return ""; }
|
||||
return this->getFamily() % QStringLiteral(" [family") %
|
||||
(this->hasDesignator() ? (QStringLiteral(" ") % this->getDesignator()) : QString()) %
|
||||
(this->hasManufacturer() ? (QStringLiteral(" ") % this->getManufacturer()) : QString()) %
|
||||
(this->hasModelDescription() ? (QStringLiteral(" ") % this->getModelDescription()) : QString()) %
|
||||
return this->getFamily() % u" [family" %
|
||||
(this->hasDesignator() ? (u' ' % this->getDesignator()) : QString()) %
|
||||
(this->hasManufacturer() ? (u' ' % this->getManufacturer()) : QString()) %
|
||||
(this->hasModelDescription() ? (u' ' % this->getModelDescription()) : QString()) %
|
||||
this->getDbKeyAsStringInParentheses(" ");
|
||||
}
|
||||
|
||||
@@ -745,10 +745,10 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
// turn E to P engine
|
||||
if (combinedCode.endsWith("E")) { return QStringList({ combinedCode.leftRef(2) % QStringLiteral("P")}); }
|
||||
if (combinedCode.endsWith("E")) { return QStringList({ combinedCode.leftRef(2) % u'P' }); }
|
||||
|
||||
// turn T to H plane (tilt wing to helicopter
|
||||
if (combinedCode.startsWith("T")) { return QStringList({ QStringLiteral("H") % combinedCode.rightRef(2)}); }
|
||||
if (combinedCode.startsWith("T")) { return QStringList({ u'H' % combinedCode.rightRef(2)}); }
|
||||
|
||||
// based on engine count
|
||||
QStringList codes;
|
||||
@@ -773,18 +773,18 @@ namespace BlackMisc
|
||||
return CAircraftIcaoCode();
|
||||
}
|
||||
|
||||
const QString designator(json.value(prefix % QStringLiteral("designator")).toString());
|
||||
const QString iata(json.value(prefix % QStringLiteral("iata")).toString());
|
||||
const QString family(json.value(prefix % QStringLiteral("family")).toString());
|
||||
const QString manufacturer(json.value(prefix % QStringLiteral("manufacturer")).toString());
|
||||
const QString model(json.value(prefix % QStringLiteral("model")).toString());
|
||||
const QString modelIata(json.value(prefix % QStringLiteral("modeliata")).toString());
|
||||
const QString modelSwift(json.value(prefix % QStringLiteral("modelswift")).toString());
|
||||
const QString type(json.value(prefix % QStringLiteral("type")).toString());
|
||||
const QString engine(json.value(prefix % QStringLiteral("engine")).toString());
|
||||
const int engineCount(json.value(prefix % QStringLiteral("enginecount")).toInt(-1));
|
||||
const QString designator(json.value(prefix % u"designator").toString());
|
||||
const QString iata(json.value(prefix % u"iata").toString());
|
||||
const QString family(json.value(prefix % u"family").toString());
|
||||
const QString manufacturer(json.value(prefix % u"manufacturer").toString());
|
||||
const QString model(json.value(prefix % u"model").toString());
|
||||
const QString modelIata(json.value(prefix % u"modeliata").toString());
|
||||
const QString modelSwift(json.value(prefix % u"modelswift").toString());
|
||||
const QString type(json.value(prefix % u"type").toString());
|
||||
const QString engine(json.value(prefix % u"engine").toString());
|
||||
const int engineCount(json.value(prefix % u"enginecount").toInt(-1));
|
||||
const QString combined(createdCombinedString(type, engineCount, engine));
|
||||
QString wtc(json.value(prefix % QStringLiteral("wtc")).toString());
|
||||
QString wtc(json.value(prefix % u"wtc").toString());
|
||||
if (wtc.length() > 1 && wtc.contains("/"))
|
||||
{
|
||||
// "L/M" -> "M"
|
||||
@@ -792,10 +792,10 @@ namespace BlackMisc
|
||||
}
|
||||
Q_ASSERT_X(wtc.length() < 2, Q_FUNC_INFO, "WTC too long");
|
||||
|
||||
const bool real = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QStringLiteral("realworld")).toString());
|
||||
const bool legacy = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QStringLiteral("legacy")).toString());
|
||||
const bool military = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QStringLiteral("military")).toString());
|
||||
const int rank(json.value(prefix % QStringLiteral("rank")).toInt(10));
|
||||
const bool real = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % u"realworld").toString());
|
||||
const bool legacy = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % u"legacy").toString());
|
||||
const bool military = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % u"military").toString());
|
||||
const int rank(json.value(prefix % u"rank").toInt(10));
|
||||
|
||||
CAircraftIcaoCode code(
|
||||
designator, iata, family, combined, manufacturer,
|
||||
|
||||
@@ -87,14 +87,14 @@ namespace BlackMisc
|
||||
QString CAircraftLights::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
const QString s = QLatin1String("strobe: ") % boolToYesNo(m_strobeOn) %
|
||||
QLatin1String(" landing: ") % boolToYesNo(m_landingOn) %
|
||||
QLatin1String(" taxi: ") % boolToYesNo(m_taxiOn) %
|
||||
QLatin1String(" beacon: ") % boolToYesNo(m_beaconOn) %
|
||||
QLatin1String(" nav: ") % boolToYesNo(m_navOn) %
|
||||
QLatin1String(" logo: ") % boolToYesNo(m_logoOn) %
|
||||
QLatin1String(" recognition: ") % boolToYesNo(m_recognition) %
|
||||
QLatin1String(" cabin: ") % boolToYesNo(m_cabin);
|
||||
const QString s = u"strobe: " % boolToYesNo(m_strobeOn) %
|
||||
u" landing: " % boolToYesNo(m_landingOn) %
|
||||
u" taxi: " % boolToYesNo(m_taxiOn) %
|
||||
u" beacon: " % boolToYesNo(m_beaconOn) %
|
||||
u" nav: " % boolToYesNo(m_navOn) %
|
||||
u" logo: " % boolToYesNo(m_logoOn) %
|
||||
u" recognition: " % boolToYesNo(m_recognition) %
|
||||
u" cabin: " % boolToYesNo(m_cabin);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,15 +44,15 @@ namespace BlackMisc
|
||||
|
||||
QString CAircraftParts::convertToQString(bool i18n) const
|
||||
{
|
||||
return QStringLiteral("ts: ") % this->getFormattedTimestampAndOffset(true) %
|
||||
QStringLiteral(" details: ") % this->getPartsDetailsAsString() %
|
||||
(m_guessingDetails.isEmpty() ? QString() : QStringLiteral(" - ") % m_guessingDetails) %
|
||||
QStringLiteral(" | on ground: ") % BlackMisc::boolToYesNo(m_isOnGround) %
|
||||
QStringLiteral(" | lights: ") % m_lights.toQString(i18n) %
|
||||
QStringLiteral(" | gear down: ") % BlackMisc::boolToYesNo(m_gearDown) %
|
||||
QStringLiteral(" | flaps pct: ") % QString::number(m_flapsPercentage) %
|
||||
QStringLiteral(" | spoilers out: ") % BlackMisc::boolToYesNo(m_spoilersOut) %
|
||||
QStringLiteral(" | engines on: ") % m_engines.toQString(i18n);
|
||||
return u"ts: " % this->getFormattedTimestampAndOffset(true) %
|
||||
u" details: " % this->getPartsDetailsAsString() %
|
||||
(m_guessingDetails.isEmpty() ? QString() : u" - " % m_guessingDetails) %
|
||||
u" | on ground: " % BlackMisc::boolToYesNo(m_isOnGround) %
|
||||
u" | lights: " % m_lights.toQString(i18n) %
|
||||
u" | gear down: " % BlackMisc::boolToYesNo(m_gearDown) %
|
||||
u" | flaps pct: " % QString::number(m_flapsPercentage) %
|
||||
u" | spoilers out: " % BlackMisc::boolToYesNo(m_spoilersOut) %
|
||||
u" | engines on: " % m_engines.toQString(i18n);
|
||||
}
|
||||
|
||||
QJsonObject CAircraftParts::toIncrementalJson() const
|
||||
@@ -130,13 +130,13 @@ namespace BlackMisc
|
||||
const CSpeed slowSpeed = guessedVRotate * 0.30;
|
||||
if (situation.getGroundSpeed() < slowSpeed)
|
||||
{
|
||||
if (details) { *details += QStringLiteral("slow speed <") % slowSpeed.valueRoundedWithUnit(1) % QStringLiteral(" on ground"); }
|
||||
if (details) { *details += u"slow speed <" % slowSpeed.valueRoundedWithUnit(1) % u" on ground"; }
|
||||
parts.setFlapsPercent(0);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (details) { *details += QStringLiteral("faster speed >") % slowSpeed.valueRoundedWithUnit(1) % QStringLiteral(" on ground"); }
|
||||
if (details) { *details += u"faster speed >" % slowSpeed.valueRoundedWithUnit(1) % u" on ground"; }
|
||||
parts.setFlapsPercent(0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -67,24 +67,24 @@ namespace BlackMisc
|
||||
|
||||
QString CAircraftSituation::convertToQString(bool i18n) const
|
||||
{
|
||||
return QStringLiteral("ts: ") % this->getFormattedTimestampAndOffset(true) %
|
||||
QStringLiteral(" | ") % m_position.toQString(i18n) %
|
||||
QStringLiteral(" | alt: ") % this->getAltitude().valueRoundedWithUnit(CLengthUnit::ft(), 1) %
|
||||
QStringLiteral(" ") % this->getCorrectedAltitude().valueRoundedWithUnit(CLengthUnit::ft(), 1) %
|
||||
QStringLiteral("[cor] | og: ") % this->getOnGroundInfo() %
|
||||
(m_onGroundGuessingDetails.isEmpty() ? QString() : QStringLiteral(" ") % m_onGroundGuessingDetails) %
|
||||
QStringLiteral(" | cg: ") %
|
||||
(m_cg.isNull() ? QStringLiteral("null") : m_cg.valueRoundedWithUnit(CLengthUnit::m(), 1) % QStringLiteral(" ") % m_cg.valueRoundedWithUnit(CLengthUnit::ft(), 1)) %
|
||||
QStringLiteral(" | offset: ") %
|
||||
(m_sceneryOffset.isNull() ? QStringLiteral("null") : m_sceneryOffset.valueRoundedWithUnit(CLengthUnit::m(), 1) % QStringLiteral(" ") % m_sceneryOffset.valueRoundedWithUnit(CLengthUnit::ft(), 1)) %
|
||||
QStringLiteral(" | factor [0..1]: ") % QString::number(m_onGroundFactor, 'f', 2) %
|
||||
QStringLiteral(" | skip ng: ") % boolToYesNo(this->canLikelySkipNearGroundInterpolation()) %
|
||||
QStringLiteral(" | bank: ") % m_bank.toQString(i18n) %
|
||||
QStringLiteral(" | pitch: ") % m_pitch.toQString(i18n) %
|
||||
QStringLiteral(" | heading: ") % m_heading.toQString(i18n) %
|
||||
QStringLiteral(" | gs: ") % m_groundSpeed.valueRoundedWithUnit(CSpeedUnit::kts(), 1, true) %
|
||||
QStringLiteral(" ") % m_groundSpeed.valueRoundedWithUnit(CSpeedUnit::m_s(), 1, true) %
|
||||
QStringLiteral(" | elevation [") % this->getGroundElevationInfoAsString() % QStringLiteral("]: ") % (m_groundElevationPlane.toQString(i18n));
|
||||
return u"ts: " % this->getFormattedTimestampAndOffset(true) %
|
||||
u" | " % m_position.toQString(i18n) %
|
||||
u" | alt: " % this->getAltitude().valueRoundedWithUnit(CLengthUnit::ft(), 1) %
|
||||
u' ' % this->getCorrectedAltitude().valueRoundedWithUnit(CLengthUnit::ft(), 1) %
|
||||
u"[cor] | og: " % this->getOnGroundInfo() %
|
||||
(m_onGroundGuessingDetails.isEmpty() ? QString() : u' ' % m_onGroundGuessingDetails) %
|
||||
u" | cg: " %
|
||||
(m_cg.isNull() ? QStringLiteral("null") : m_cg.valueRoundedWithUnit(CLengthUnit::m(), 1) % u' ' % m_cg.valueRoundedWithUnit(CLengthUnit::ft(), 1)) %
|
||||
u" | offset: " %
|
||||
(m_sceneryOffset.isNull() ? QStringLiteral("null") : m_sceneryOffset.valueRoundedWithUnit(CLengthUnit::m(), 1) % u' ' % m_sceneryOffset.valueRoundedWithUnit(CLengthUnit::ft(), 1)) %
|
||||
u" | factor [0..1]: " % QString::number(m_onGroundFactor, 'f', 2) %
|
||||
u" | skip ng: " % boolToYesNo(this->canLikelySkipNearGroundInterpolation()) %
|
||||
u" | bank: " % m_bank.toQString(i18n) %
|
||||
u" | pitch: " % m_pitch.toQString(i18n) %
|
||||
u" | heading: " % m_heading.toQString(i18n) %
|
||||
u" | gs: " % m_groundSpeed.valueRoundedWithUnit(CSpeedUnit::kts(), 1, true) %
|
||||
u' ' % m_groundSpeed.valueRoundedWithUnit(CSpeedUnit::m_s(), 1, true) %
|
||||
u" | elevation [" % this->getGroundElevationInfoAsString() % u"]: " % (m_groundElevationPlane.toQString(i18n));
|
||||
}
|
||||
|
||||
const QString &CAircraftSituation::isOnGroundToString(CAircraftSituation::IsOnGround onGround)
|
||||
@@ -590,7 +590,7 @@ namespace BlackMisc
|
||||
// "extreme" values for which we are surely not on ground
|
||||
if (qAbs(this->getPitch().value(CAngleUnit::deg())) > 20) { if (details) { *details = QStringLiteral("max.pitch"); }; return true; } // some tail wheel aircraft already have 11° pitch on ground
|
||||
if (qAbs(this->getBank().value(CAngleUnit::deg())) > 10) { if (details) { *details = QStringLiteral("max.bank"); }; return true; }
|
||||
if (this->getGroundSpeed() > sureRotateSpeed) { if (details) { *details = QStringLiteral("gs. > vr ") % sureRotateSpeed.valueRoundedWithUnit(1); }; return true; }
|
||||
if (this->getGroundSpeed() > sureRotateSpeed) { if (details) { *details = u"gs. > vr " % sureRotateSpeed.valueRoundedWithUnit(1); }; return true; }
|
||||
|
||||
// use the most accurate or reliable guesses here first
|
||||
// ------------------------------------------------------
|
||||
@@ -710,7 +710,7 @@ namespace BlackMisc
|
||||
|
||||
QString CAircraftSituation::getOnGroundInfo() const
|
||||
{
|
||||
return this->onGroundAsString() % QLatin1Char(' ') % this->getOnGroundDetailsAsString();
|
||||
return this->onGroundAsString() % u' ' % this->getOnGroundDetailsAsString();
|
||||
}
|
||||
|
||||
CAircraftSituation::GndElevationInfo CAircraftSituation::getGroundElevationInfo() const
|
||||
@@ -722,7 +722,7 @@ namespace BlackMisc
|
||||
QString CAircraftSituation::getGroundElevationInfoAsString() const
|
||||
{
|
||||
return m_isElvInfoTransferred ?
|
||||
QStringLiteral("tx: ") % gndElevationInfoToString(this->getGroundElevationInfo()) :
|
||||
u"tx: " % gndElevationInfoToString(this->getGroundElevationInfo()) :
|
||||
gndElevationInfoToString(this->getGroundElevationInfo());
|
||||
}
|
||||
|
||||
@@ -732,7 +732,7 @@ namespace BlackMisc
|
||||
if (m_groundElevationPlane.isNull()) { return n; };
|
||||
|
||||
return m_groundElevationPlane.getAltitude().toQString(true) %
|
||||
QStringLiteral(" [") % this->getGroundElevationInfoAsString() % QStringLiteral("]");
|
||||
u" [" % this->getGroundElevationInfoAsString() % u']';
|
||||
}
|
||||
|
||||
bool CAircraftSituation::canTransferGroundElevation(const CAircraftSituation &transferToSituation, const CLength &radius) const
|
||||
|
||||
@@ -111,23 +111,23 @@ namespace BlackMisc
|
||||
Q_UNUSED(i18n);
|
||||
static const QString null("null");
|
||||
if (this->isNull()) { return null; }
|
||||
return QStringLiteral("CS: '") % this->getCallsign().asString() %
|
||||
QStringLiteral(" ' ts: ") % this->getTimestampAndOffset(true) %
|
||||
QStringLiteral(" | situations:") % QString::number(m_situationsCount) %
|
||||
QStringLiteral(" | ts adj.: ") % QString::number(m_oldestAdjustedTimestampMSecsSinceEpoch) % QStringLiteral("-") % QString::number(m_latestAdjustedTimestampMSecsSinceEpoch) %
|
||||
QStringLiteral(" | just takeoff: ") % boolToYesNo(this->isJustTakingOff()) % QStringLiteral(" just touchdown: ") % boolToYesNo(this->isJustTouchingDown()) %
|
||||
QStringLiteral(" | all gnd: ") % boolToYesNo(this->isConstOnGround()) % QStringLiteral("/") % boolToYesNo(this->wasConstOnGround()) %
|
||||
QStringLiteral(" | all not gnd: ") % boolToYesNo(this->isConstNotOnGround()) % QStringLiteral("/") % boolToYesNo(this->wasConstNotOnGround()) %
|
||||
QStringLiteral(" | ascending: ") % boolToYesNo(this->isConstAscending()) % QStringLiteral(" descending: ") % boolToYesNo(this->isConstDescending()) %
|
||||
QStringLiteral(" | accelerating.: ") % boolToYesNo(this->isConstAccelerating()) % QStringLiteral(" decelarating: ") % boolToYesNo(this->isConstDecelarating()) %
|
||||
QStringLiteral(" | rotate up: ") % boolToYesNo(this->isRotatingUp()) %
|
||||
QStringLiteral(" | push back: ") % boolToYesNo(this->containsPushBack()) %
|
||||
QStringLiteral(" | scenery delta: ") % m_guessedSceneryDeviation.valueRoundedWithUnit(1) % QStringLiteral(" [") % this->getSceneryDeviationHintAsString() %
|
||||
QStringLiteral("] | AGL delta: ") % m_gndDistMean.valueRoundedWithUnit(1) % QStringLiteral("/") % m_gndDistStdDev.valueRoundedWithUnit(1) %
|
||||
QStringLiteral(" | std.dev/mean: pitch ") % m_pitchMean.valueRoundedWithUnit(1) % QStringLiteral("/") % m_pitchStdDev.valueRoundedWithUnit(1) %
|
||||
QStringLiteral(" gs ") % m_gsMean.valueRoundedWithUnit(1) % QStringLiteral("/") % m_gsStdDev.valueRoundedWithUnit(1) %
|
||||
QStringLiteral(" alt. ") % m_altMean.valueRoundedWithUnit(1) % QStringLiteral("/") % m_altStdDev.valueRoundedWithUnit(1) %
|
||||
QStringLiteral(" elv. ") % m_elvMean.valueRoundedWithUnit(1) % QStringLiteral("/") % m_elvStdDev.valueRoundedWithUnit(1);
|
||||
return u"CS: '" % this->getCallsign().asString() %
|
||||
u" ' ts: " % this->getTimestampAndOffset(true) %
|
||||
u" | situations:" % QString::number(m_situationsCount) %
|
||||
u" | ts adj.: " % QString::number(m_oldestAdjustedTimestampMSecsSinceEpoch) % u'-' % QString::number(m_latestAdjustedTimestampMSecsSinceEpoch) %
|
||||
u" | just takeoff: " % boolToYesNo(this->isJustTakingOff()) % u" just touchdown: " % boolToYesNo(this->isJustTouchingDown()) %
|
||||
u" | all gnd: " % boolToYesNo(this->isConstOnGround()) % u'/' % boolToYesNo(this->wasConstOnGround()) %
|
||||
u" | all not gnd: " % boolToYesNo(this->isConstNotOnGround()) % u'/' % boolToYesNo(this->wasConstNotOnGround()) %
|
||||
u" | ascending: " % boolToYesNo(this->isConstAscending()) % u" descending: " % boolToYesNo(this->isConstDescending()) %
|
||||
u" | accelerating.: " % boolToYesNo(this->isConstAccelerating()) % u" decelarating: " % boolToYesNo(this->isConstDecelarating()) %
|
||||
u" | rotate up: " % boolToYesNo(this->isRotatingUp()) %
|
||||
u" | push back: " % boolToYesNo(this->containsPushBack()) %
|
||||
u" | scenery delta: " % m_guessedSceneryDeviation.valueRoundedWithUnit(1) % u" [" % this->getSceneryDeviationHintAsString() %
|
||||
u"] | AGL delta: " % m_gndDistMean.valueRoundedWithUnit(1) % u'/' % m_gndDistStdDev.valueRoundedWithUnit(1) %
|
||||
u" | std.dev/mean: pitch " % m_pitchMean.valueRoundedWithUnit(1) % u'/' % m_pitchStdDev.valueRoundedWithUnit(1) %
|
||||
u" gs " % m_gsMean.valueRoundedWithUnit(1) % u'/' % m_gsStdDev.valueRoundedWithUnit(1) %
|
||||
u" alt. " % m_altMean.valueRoundedWithUnit(1) % u'/' % m_altStdDev.valueRoundedWithUnit(1) %
|
||||
u" elv. " % m_elvMean.valueRoundedWithUnit(1) % u'/' % m_elvStdDev.valueRoundedWithUnit(1);
|
||||
}
|
||||
|
||||
CVariant CAircraftSituationChange::propertyByIndex(const CPropertyIndex &index) const
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace BlackMisc
|
||||
const QString CAirlineIcaoCode::getVDesignator() const
|
||||
{
|
||||
if (!this->isVirtualAirline()) { return m_designator; }
|
||||
return QLatin1Char('V') % m_designator;
|
||||
return u'V' % m_designator;
|
||||
}
|
||||
|
||||
QString CAirlineIcaoCode::getVDesignatorDbKey() const
|
||||
@@ -91,8 +91,8 @@ namespace BlackMisc
|
||||
QString CAirlineIcaoCode::getDesignatorNameCountry() const
|
||||
{
|
||||
return this->getDesignator() %
|
||||
(this->hasName() ? (QStringLiteral(" ") % this->getName()) : QString()) %
|
||||
(this->hasValidCountry() ? (QStringLiteral(" ") % this->getCountryIso()) : QString());
|
||||
(this->hasName() ? (u' ' % this->getName()) : QString()) %
|
||||
(this->hasValidCountry() ? (u' ' % this->getCountryIso()) : QString());
|
||||
}
|
||||
|
||||
QString CAirlineIcaoCode::getSimplifiedName() const
|
||||
@@ -185,10 +185,10 @@ namespace BlackMisc
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
return this->getDesignatorDbKey() %
|
||||
(this->hasName() ? QStringLiteral(" ") % m_name : QString()) %
|
||||
QStringLiteral(" Op: ") % boolToYesNo(this->isOperating()) %
|
||||
QStringLiteral(" VA: ") % boolToYesNo(this->isVirtualAirline()) %
|
||||
QStringLiteral(" Mil: ") % boolToYesNo(this->isMilitary());
|
||||
(this->hasName() ? u' ' % m_name : QString()) %
|
||||
u" Op: " % boolToYesNo(this->isOperating()) %
|
||||
u" VA: " % boolToYesNo(this->isVirtualAirline()) %
|
||||
u" Mil: " % boolToYesNo(this->isMilitary());
|
||||
}
|
||||
|
||||
CVariant CAirlineIcaoCode::propertyByIndex(const CPropertyIndex &index) const
|
||||
@@ -303,7 +303,7 @@ namespace BlackMisc
|
||||
QString CAirlineIcaoCode::getCombinedStringWithKey() const
|
||||
{
|
||||
return (this->hasValidDesignator() ? this->getVDesignator() : QString()) %
|
||||
(this->hasName() ? QStringLiteral(" ") % m_name : QString()) %
|
||||
(this->hasName() ? u' ' % m_name : QString()) %
|
||||
this->getDbKeyAsStringInParentheses(" ");
|
||||
}
|
||||
|
||||
@@ -427,23 +427,23 @@ namespace BlackMisc
|
||||
return CAirlineIcaoCode();
|
||||
}
|
||||
|
||||
QString designator(json.value(prefix % QStringLiteral("designator")).toString());
|
||||
QString designator(json.value(prefix % u"designator").toString());
|
||||
if (!CAirlineIcaoCode::isValidAirlineDesignator(designator))
|
||||
{
|
||||
designator = CAirlineIcaoCode::normalizeDesignator(designator);
|
||||
}
|
||||
|
||||
const QString iata(json.value(prefix % QStringLiteral("iata")).toString());
|
||||
const QString telephony(json.value(prefix % QStringLiteral("callsign")).toString());
|
||||
const QString name(json.value(prefix % QStringLiteral("name")).toString());
|
||||
const QString countryIso(json.value(prefix % QStringLiteral("country")).toString());
|
||||
const QString countryName(json.value(prefix % QStringLiteral("countryname")).toString());
|
||||
const QString groupName(json.value(prefix % QStringLiteral("groupname")).toString());
|
||||
const QString groupDesignator(json.value(prefix % QStringLiteral("groupdesignator")).toString());
|
||||
const int groupId(json.value(prefix % QStringLiteral("groupid")).toInt(-1));
|
||||
const bool va = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QStringLiteral("va")).toString());
|
||||
const bool operating = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QStringLiteral("operating")).toString());
|
||||
const bool military = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QStringLiteral("military")).toString());
|
||||
const QString iata(json.value(prefix % u"iata").toString());
|
||||
const QString telephony(json.value(prefix % u"callsign").toString());
|
||||
const QString name(json.value(prefix % u"name").toString());
|
||||
const QString countryIso(json.value(prefix % u"country").toString());
|
||||
const QString countryName(json.value(prefix % u"countryname").toString());
|
||||
const QString groupName(json.value(prefix % u"groupname").toString());
|
||||
const QString groupDesignator(json.value(prefix % u"groupdesignator").toString());
|
||||
const int groupId(json.value(prefix % u"groupid").toInt(-1));
|
||||
const bool va = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % u"va").toString());
|
||||
const bool operating = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % u"operating").toString());
|
||||
const bool military = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % u"military").toString());
|
||||
|
||||
CAirlineIcaoCode code(
|
||||
designator, name,
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace BlackMisc
|
||||
if (m_location.isEmpty()) { return this->getDescriptiveName(); }
|
||||
if (m_descriptiveName.isEmpty()) { return this->getLocation(); }
|
||||
if (this->getDescriptiveName() == this->getLocation()) { return this->getLocation(); }
|
||||
return this->getLocation() % QStringLiteral(" (") % this->getDescriptiveName() % QStringLiteral(")");
|
||||
return this->getLocation() % u" (" % this->getDescriptiveName() % u')';
|
||||
}
|
||||
|
||||
bool CAirport::matchesLocation(const QString &location) const
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace BlackMisc
|
||||
else
|
||||
{
|
||||
return this->CLength::valueRoundedWithUnit(1, i18n) %
|
||||
(this->isMeanSeaLevel() ? QStringLiteral(" MSL") : QStringLiteral(" AGL"));
|
||||
(this->isMeanSeaLevel() ? u" MSL" : u" AGL");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (m_callsign.isEmpty()) { return this->getControllerRealName(); }
|
||||
if (!m_controller.hasRealName()) { return m_callsign.asString(); }
|
||||
return m_callsign.asString() % QStringLiteral(" ") % this->getControllerRealName();
|
||||
return m_callsign.asString() % u' ' % this->getControllerRealName();
|
||||
}
|
||||
|
||||
void CAtcStation::setController(const CUser &controller)
|
||||
@@ -101,43 +101,43 @@ namespace BlackMisc
|
||||
static const QString fromUtcI18n(QCoreApplication::translate("Aviation", "from(UTC)"));
|
||||
static const QString untilUtcI18n(QCoreApplication::translate("Aviation", "until(UTC)"));
|
||||
|
||||
const QString s = (i18n ? atcI18n : QLatin1String("ATC station")) %
|
||||
QLatin1Char(' ') % m_callsign.toQString(i18n) %
|
||||
QLatin1Char(' ') % m_position.toQString(i18n) %
|
||||
QLatin1String(" online: ") % boolToYesNo(m_isOnline) %
|
||||
const QString s = (i18n ? atcI18n : QStringLiteral("ATC station")) %
|
||||
u' ' % m_callsign.toQString(i18n) %
|
||||
u' ' % m_position.toQString(i18n) %
|
||||
u" online: " % boolToYesNo(m_isOnline) %
|
||||
|
||||
// controller
|
||||
(m_controller.isNull() ? QString() :
|
||||
QStringLiteral(" ") % m_controller.toQString(i18n)) %
|
||||
u' ' % m_controller.toQString(i18n)) %
|
||||
|
||||
// frequency
|
||||
QLatin1Char(' ') % m_frequency.valueRoundedWithUnit(3, i18n) %
|
||||
u' ' % m_frequency.valueRoundedWithUnit(3, i18n) %
|
||||
|
||||
// ATIS
|
||||
(!this->hasAtis() ? QString() :
|
||||
QStringLiteral(" ") % m_atis.toQString(i18n)) %
|
||||
u' ' % m_atis.toQString(i18n)) %
|
||||
|
||||
// METAR
|
||||
(!this->hasMetar() ? QString() :
|
||||
QStringLiteral(" ") % m_metar.toQString(i18n)) %
|
||||
u' ' % m_metar.toQString(i18n)) %
|
||||
|
||||
// range
|
||||
QLatin1Char(' ') % (i18n ? rangeI18n : QLatin1String("range")) %
|
||||
QLatin1Char(' ') % m_range.toQString(i18n) %
|
||||
u' ' % (i18n ? rangeI18n : QStringLiteral("range")) %
|
||||
u' ' % m_range.toQString(i18n) %
|
||||
|
||||
// distance / bearing
|
||||
QLatin1Char(' ') % ICoordinateWithRelativePosition::convertToQString(i18n) %
|
||||
u' ' % ICoordinateWithRelativePosition::convertToQString(i18n) %
|
||||
|
||||
// booking from/until
|
||||
QLatin1Char(' ') %
|
||||
(i18n ? fromUtcI18n : QLatin1String("from(UTC)")) %
|
||||
QLatin1Char(' ') %
|
||||
(m_bookedFromUtc.isNull() ? QLatin1String("-") : m_bookedFromUtc.toString("yy-MM-dd HH:mm")) %
|
||||
u' ' %
|
||||
(i18n ? fromUtcI18n : QStringLiteral("from(UTC)")) %
|
||||
u' ' %
|
||||
(m_bookedFromUtc.isNull() ? QStringLiteral("-") : m_bookedFromUtc.toString("yy-MM-dd HH:mm")) %
|
||||
|
||||
QLatin1Char(' ') %
|
||||
(i18n ? untilUtcI18n : QLatin1String("until(UTC)")) %
|
||||
QLatin1Char(' ') %
|
||||
(m_bookedUntilUtc.isNull() ? QLatin1String("-") : m_bookedUntilUtc.toString("yy-MM-dd HH:mm"));
|
||||
u' ' %
|
||||
(i18n ? untilUtcI18n : QStringLiteral("until(UTC)")) %
|
||||
u' ' %
|
||||
(m_bookedUntilUtc.isNull() ? QStringLiteral("-") : m_bookedUntilUtc.toString("yy-MM-dd HH:mm"));
|
||||
|
||||
return s;
|
||||
|
||||
|
||||
@@ -65,12 +65,12 @@ namespace BlackMisc
|
||||
QString CFlightPlanRemarks::convertToQString(bool i18n) const
|
||||
{
|
||||
const QString s =
|
||||
(m_registration.isEmpty() ? QString() : QStringLiteral("reg.: ") % m_registration.toQString(i18n))
|
||||
% (!this->hasValidAirlineIcao() ? QString() : QStringLiteral(" airline: ") % m_airlineIcao.getDesignator())
|
||||
% (m_radioTelephony.isEmpty() ? QString() : QStringLiteral(" radio tel.:") % m_radioTelephony)
|
||||
% (m_flightOperator.isEmpty() ? QString() : QStringLiteral(" operator: ") % m_flightOperator)
|
||||
% (!m_selcalCode.isValid() ? QString() : QStringLiteral(" SELCAL: ") % m_selcalCode.getCode())
|
||||
% QStringLiteral(" voice: ") % m_voiceCapabilities.toQString(i18n);
|
||||
(m_registration.isEmpty() ? QString() : u"reg.: " % m_registration.toQString(i18n))
|
||||
% (!this->hasValidAirlineIcao() ? QString() : u" airline: " % m_airlineIcao.getDesignator())
|
||||
% (m_radioTelephony.isEmpty() ? QString() : u" radio tel.:" % m_radioTelephony)
|
||||
% (m_flightOperator.isEmpty() ? QString() : u" operator: " % m_flightOperator)
|
||||
% (!m_selcalCode.isValid() ? QString() : u" SELCAL: " % m_selcalCode.getCode())
|
||||
% u" voice: " % m_voiceCapabilities.toQString(i18n);
|
||||
return s.simplified().trimmed();
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace BlackMisc
|
||||
if (r.contains("/V/", Qt::CaseInsensitive)) { r.replace("/V/", newCapRemarks, Qt::CaseInsensitive); return r; }
|
||||
if (r.contains("/R/", Qt::CaseInsensitive)) { r.replace("/R/", newCapRemarks, Qt::CaseInsensitive); return r; }
|
||||
if (r.contains("/T/", Qt::CaseInsensitive)) { r.replace("/T/", newCapRemarks, Qt::CaseInsensitive); return r; }
|
||||
return newCapRemarks % QStringLiteral(" ") % r;
|
||||
return newCapRemarks % u' ' % r;
|
||||
}
|
||||
|
||||
QString CFlightPlanRemarks::cleanRemarks(const QString &remarksIn)
|
||||
@@ -282,18 +282,18 @@ namespace BlackMisc
|
||||
QString CFlightPlan::convertToQString(bool i18n) const
|
||||
{
|
||||
const QString s = m_callsign.toQString(i18n)
|
||||
% QLatin1Char(' ') % m_equipmentSuffix
|
||||
% QLatin1Char(' ') % m_originAirportIcao.toQString(i18n)
|
||||
% QLatin1Char(' ') % m_destinationAirportIcao.toQString(i18n)
|
||||
% QLatin1Char(' ') % m_alternateAirportIcao.toQString(i18n)
|
||||
% QLatin1Char(' ') % m_takeoffTimePlanned.toString("ddhhmm")
|
||||
% QLatin1Char(' ') % m_takeoffTimeActual.toString("ddhhmm")
|
||||
% QLatin1Char(' ') % m_enrouteTime.toQString(i18n)
|
||||
% QLatin1Char(' ') % m_fuelTime.toQString(i18n)
|
||||
% QLatin1Char(' ') % m_cruiseAltitude.toQString(i18n)
|
||||
% QLatin1Char(' ') % m_cruiseTrueAirspeed.toQString(i18n)
|
||||
% QLatin1Char(' ') % m_route
|
||||
% QLatin1Char(' ') % this->getRemarks();
|
||||
% u' ' % m_equipmentSuffix
|
||||
% u' ' % m_originAirportIcao.toQString(i18n)
|
||||
% u' ' % m_destinationAirportIcao.toQString(i18n)
|
||||
% u' ' % m_alternateAirportIcao.toQString(i18n)
|
||||
% u' ' % m_takeoffTimePlanned.toString("ddhhmm")
|
||||
% u' ' % m_takeoffTimeActual.toString("ddhhmm")
|
||||
% u' ' % m_enrouteTime.toQString(i18n)
|
||||
% u' ' % m_fuelTime.toQString(i18n)
|
||||
% u' ' % m_cruiseAltitude.toQString(i18n)
|
||||
% u' ' % m_cruiseTrueAirspeed.toQString(i18n)
|
||||
% u' ' % m_route
|
||||
% u' ' % this->getRemarks();
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -587,11 +587,11 @@ namespace BlackMisc
|
||||
QString s = prefix;
|
||||
if (!icao.isEmpty())
|
||||
{
|
||||
s += (s.isEmpty() ? QString() : QStringLiteral("/")) % icao;
|
||||
s += (s.isEmpty() ? u"" : u"/") % icao;
|
||||
}
|
||||
if (suffix.isEmpty()) { return s; }
|
||||
if (s.isEmpty()) { return suffix; }
|
||||
return s % QStringLiteral("/") % suffix;
|
||||
return s % u'/' % suffix;
|
||||
}
|
||||
|
||||
CFlightPlan::FlightRules CFlightPlan::stringToFlightRules(const QString &flightRules)
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace BlackMisc
|
||||
return this->getCombinedCode() % (
|
||||
this->getDescription().isEmpty() ?
|
||||
QString() :
|
||||
(QStringLiteral(" ") % this->getDescription())
|
||||
(u' ' % this->getDescription())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -134,12 +134,12 @@ namespace BlackMisc
|
||||
static const QString liveryI18n(QCoreApplication::translate("Aviation", "Livery"));
|
||||
|
||||
return (i18n ? liveryI18n : livery) %
|
||||
QLatin1String(" cc: '") % m_combinedCode %
|
||||
QLatin1String("' airline: '") % m_airline.toQString(i18n) %
|
||||
QLatin1String("' desc.: '") % m_description %
|
||||
QLatin1String("' F: '") % m_colorFuselage.hex() %
|
||||
QLatin1String("' T: '") % m_colorTail.hex() %
|
||||
QLatin1String("' Mil: ") % boolToYesNo(this->isMilitary());
|
||||
u" cc: '" % m_combinedCode %
|
||||
u"' airline: '" % m_airline.toQString(i18n) %
|
||||
u"' desc.: '" % m_description %
|
||||
u"' F: '" % m_colorFuselage.hex() %
|
||||
u"' T: '" % m_colorTail.hex() %
|
||||
u"' Mil: " % boolToYesNo(this->isMilitary());
|
||||
|
||||
// force strings for translation in resource files
|
||||
(void)QT_TRANSLATE_NOOP("Aviation", "Livery");
|
||||
@@ -239,7 +239,7 @@ namespace BlackMisc
|
||||
return CLivery();
|
||||
}
|
||||
|
||||
const QString combinedCode(json.value(prefix % QStringLiteral("combinedcode")).toString());
|
||||
const QString combinedCode(json.value(prefix % u"combinedcode").toString());
|
||||
if (combinedCode.isEmpty())
|
||||
{
|
||||
CLivery liveryStub; // only consists of id, maybe key and timestamp
|
||||
@@ -248,10 +248,10 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
const bool isColorLivery = combinedCode.startsWith(colorLiveryMarker());
|
||||
const QString description(json.value(prefix % QStringLiteral("description")).toString());
|
||||
const CRgbColor colorFuselage(json.value(prefix % QStringLiteral("colorfuselage")).toString());
|
||||
const CRgbColor colorTail(json.value(prefix % QStringLiteral("colortail")).toString());
|
||||
const bool military = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QStringLiteral("military")).toString());
|
||||
const QString description(json.value(prefix % u"description").toString());
|
||||
const CRgbColor colorFuselage(json.value(prefix % u"colorfuselage").toString());
|
||||
const CRgbColor colorTail(json.value(prefix % u"colortail").toString());
|
||||
const bool military = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % u"military").toString());
|
||||
CAirlineIcaoCode airline;
|
||||
if (!isColorLivery) { airline = CAirlineIcaoCode::fromDatabaseJson(json, "al_"); }
|
||||
CLivery livery(combinedCode, airline, description, colorFuselage, colorTail, military);
|
||||
@@ -271,7 +271,7 @@ namespace BlackMisc
|
||||
return CLivery();
|
||||
}
|
||||
|
||||
const QString combinedCode(json.value(prefix % QStringLiteral("combinedcode")).toString());
|
||||
const QString combinedCode(json.value(prefix % u"combinedcode").toString());
|
||||
if (combinedCode.isEmpty())
|
||||
{
|
||||
CLivery liveryStub; // only consists of id, maybe key and timestamp
|
||||
@@ -280,16 +280,16 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
const bool isColorLivery = combinedCode.startsWith(colorLiveryMarker());
|
||||
const QString description(json.value(prefix % QStringLiteral("description")).toString());
|
||||
const CRgbColor colorFuselage(json.value(prefix % QStringLiteral("colorfuselage")).toString());
|
||||
const CRgbColor colorTail(json.value(prefix % QStringLiteral("colortail")).toString());
|
||||
const bool military = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % QStringLiteral("military")).toString());
|
||||
const QString description(json.value(prefix % u"description").toString());
|
||||
const CRgbColor colorFuselage(json.value(prefix % u"colorfuselage").toString());
|
||||
const CRgbColor colorTail(json.value(prefix % u"colortail").toString());
|
||||
const bool military = CDatastoreUtility::dbBoolStringToBool(json.value(prefix % u"military").toString());
|
||||
|
||||
CAirlineIcaoCode airline;
|
||||
if (!isColorLivery)
|
||||
{
|
||||
static const QString prefixAirline("al_");
|
||||
const int idAirlineIcao = json.value(prefixAirline % "id").toInt(-1);
|
||||
const int idAirlineIcao = json.value(prefixAirline % u"id").toInt(-1);
|
||||
const bool cachedAirlineIcao = idAirlineIcao >= 0 && airlineIcaos.contains(idAirlineIcao);
|
||||
|
||||
airline = cachedAirlineIcao ?
|
||||
|
||||
Reference in New Issue
Block a user