mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-10 11:36:08 +08:00
refactor: clang format line length
This commit is contained in:
@@ -80,7 +80,8 @@ namespace swift::sample
|
||||
// ATC List
|
||||
CAtcStationList atcList = CTestData::getAtcStations();
|
||||
atcList.push_back(CTestData::getAtcStations());
|
||||
atcList = atcList.findBy(&CAtcStation::getCallsign, "eddm_twr", &CAtcStation::getFrequency, CFrequency(118.7, CFrequencyUnit::MHz()));
|
||||
atcList = atcList.findBy(&CAtcStation::getCallsign, "eddm_twr", &CAtcStation::getFrequency,
|
||||
CFrequency(118.7, CFrequencyUnit::MHz()));
|
||||
atcList = atcList.sortedBy(&CAtcStation::getCallsign, &CAtcStation::getControllerRealName);
|
||||
out << atcList << Qt::endl;
|
||||
out << "-----------------------------------------------" << Qt::endl;
|
||||
|
||||
@@ -33,7 +33,8 @@ namespace swift::sample
|
||||
const QString latStr("N 48° 7′ 6.3588"); // 48.118433
|
||||
const QString lngStr("E 16° 33′ 39.924");
|
||||
out.setRealNumberPrecision(digits);
|
||||
CCoordinateGeodetic geo = CCoordinateGeodetic::fromWgs84(latStr, lngStr, CAltitude(100, CAltitude::MeanSeaLevel, CLengthUnit::m()));
|
||||
CCoordinateGeodetic geo =
|
||||
CCoordinateGeodetic::fromWgs84(latStr, lngStr, CAltitude(100, CAltitude::MeanSeaLevel, CLengthUnit::m()));
|
||||
CLatitude lat = CLatitude::fromWgs84(latStr);
|
||||
CLongitude lng = CLongitude::fromWgs84(lngStr);
|
||||
|
||||
@@ -42,13 +43,17 @@ namespace swift::sample
|
||||
CLongitude deltaLng = geo.longitude() - lng;
|
||||
|
||||
out << latStr << " " << lngStr << Qt::endl;
|
||||
out << lat.value(CAngleUnit::deg()) << " " << lat.value(CAngleUnit::sexagesimalDeg()) << " " << lng.value(CAngleUnit::deg()) << " " << lng.value(CAngleUnit::sexagesimalDeg()) << Qt::endl;
|
||||
out << geo.latitude().value(CAngleUnit::deg()) << " " << geo.latitude().value(CAngleUnit::sexagesimalDeg()) << " " << geo.longitude().value(CAngleUnit::deg()) << " " << geo.longitude().value(CAngleUnit::sexagesimalDeg()) << Qt::endl;
|
||||
out << lat.value(CAngleUnit::deg()) << " " << lat.value(CAngleUnit::sexagesimalDeg()) << " "
|
||||
<< lng.value(CAngleUnit::deg()) << " " << lng.value(CAngleUnit::sexagesimalDeg()) << Qt::endl;
|
||||
out << geo.latitude().value(CAngleUnit::deg()) << " " << geo.latitude().value(CAngleUnit::sexagesimalDeg())
|
||||
<< " " << geo.longitude().value(CAngleUnit::deg()) << " "
|
||||
<< geo.longitude().value(CAngleUnit::sexagesimalDeg()) << Qt::endl;
|
||||
|
||||
out << deltaLat.valueRoundedWithUnit(digits) << " " << deltaLng.valueRoundedWithUnit(digits) << Qt::endl;
|
||||
|
||||
// equal test
|
||||
out << "Equal? " << swift::misc::boolToYesNo(lat == geo.latitude()) << " " << swift::misc::boolToYesNo(lng == geo.longitude()) << Qt::endl;
|
||||
out << "Equal? " << swift::misc::boolToYesNo(lat == geo.latitude()) << " "
|
||||
<< swift::misc::boolToYesNo(lng == geo.longitude()) << Qt::endl;
|
||||
|
||||
// check if conversions to xyz have messed something up
|
||||
QVector3D geoVector = geo.normalVector();
|
||||
@@ -60,12 +65,14 @@ namespace swift::sample
|
||||
// Heading/bearing of same values
|
||||
CAngle bearing = geo.calculateBearing(geo);
|
||||
CLength distance = geo.calculateGreatCircleDistance(geo);
|
||||
out << bearing.valueRoundedWithUnit(CAngleUnit::deg(), 2) << " " << distance.valueRoundedWithUnit(CLengthUnit::m(), 2) << Qt::endl;
|
||||
out << bearing.valueRoundedWithUnit(CAngleUnit::deg(), 2) << " "
|
||||
<< distance.valueRoundedWithUnit(CLengthUnit::m(), 2) << Qt::endl;
|
||||
|
||||
const CCoordinateGeodetic nullCoordinate;
|
||||
bearing = geo.calculateBearing(nullCoordinate);
|
||||
distance = geo.calculateGreatCircleDistance(nullCoordinate);
|
||||
out << bearing.valueRoundedWithUnit(CAngleUnit::deg(), 2) << " " << distance.valueRoundedWithUnit(CLengthUnit::m(), 2) << Qt::endl;
|
||||
out << bearing.valueRoundedWithUnit(CAngleUnit::deg(), 2) << " "
|
||||
<< distance.valueRoundedWithUnit(CLengthUnit::m(), 2) << Qt::endl;
|
||||
|
||||
// bye
|
||||
out << "-----------------------------------------------" << Qt::endl;
|
||||
|
||||
@@ -36,7 +36,8 @@ namespace swift::sample
|
||||
CLengthUnit lu2(CLengthUnit::ft());
|
||||
QString lu1s = lu1.toQString(true);
|
||||
QString lu2s = lu2.toQString(true);
|
||||
out << "units: " << lu1 << " " << lu2 << " " << lu1s << " " << lu2s << " " << lu1.getName(true) << " " << lu2.getName(true) << Qt::endl;
|
||||
out << "units: " << lu1 << " " << lu2 << " " << lu1s << " " << lu2s << " " << lu1.getName(true) << " "
|
||||
<< lu2.getName(true) << Qt::endl;
|
||||
const CLength l1(5.0, CLengthUnit::ft()); // 5 ft
|
||||
CLength l2(1, CLengthUnit::NM()); // 1NM
|
||||
CLength l3(1, CLengthUnit::km());
|
||||
@@ -44,7 +45,8 @@ namespace swift::sample
|
||||
|
||||
out << CLengthUnit::ft() << Qt::endl;
|
||||
out << l1 << " " << l2 << " " << l3 << " " << l4 << Qt::endl;
|
||||
out << l1.valueRoundedWithUnit(CLengthUnit::ft(), 5) << " " << l2.valueRoundedWithUnit(CLengthUnit::km()) << Qt::endl;
|
||||
out << l1.valueRoundedWithUnit(CLengthUnit::ft(), 5) << " " << l2.valueRoundedWithUnit(CLengthUnit::km())
|
||||
<< Qt::endl;
|
||||
out << l3.getUnit() << Qt::endl;
|
||||
|
||||
l2.switchUnit(CLengthUnit::ft()); // now in ft
|
||||
@@ -57,17 +59,20 @@ namespace swift::sample
|
||||
|
||||
// null test
|
||||
CLength nullLength(0, CLengthUnit::nullUnit());
|
||||
out << "Null PQ: " << nullLength << " converted " << nullLength.valueRoundedWithUnit(CLengthUnit::m(), 2) << Qt::endl;
|
||||
out << "Null PQ: " << nullLength << " converted " << nullLength.valueRoundedWithUnit(CLengthUnit::m(), 2)
|
||||
<< Qt::endl;
|
||||
|
||||
// more tests
|
||||
CFrequency f1(1E6, CFrequencyUnit::Hz()); // 1MHz
|
||||
out << f1 << " " << f1.valueRoundedWithUnit(CFrequencyUnit::MHz()) << " " << f1.valueRoundedWithUnit(CFrequencyUnit::GHz(), 3);
|
||||
out << f1 << " " << f1.valueRoundedWithUnit(CFrequencyUnit::MHz()) << " "
|
||||
<< f1.valueRoundedWithUnit(CFrequencyUnit::GHz(), 3);
|
||||
|
||||
CSpeed s1 = CSpeed(100, CSpeedUnit::km_h());
|
||||
CSpeed s2 = CSpeed(1000, CSpeedUnit::ft_min());
|
||||
CSpeed s3 = CSpeed(s2);
|
||||
s3.switchUnit(CSpeedUnit::m_s());
|
||||
out << s1 << " " << s1.valueRoundedWithUnit(CSpeedUnit::defaultUnit()) << " " << s1.valueRoundedWithUnit(CSpeedUnit::NM_h());
|
||||
out << s1 << " " << s1.valueRoundedWithUnit(CSpeedUnit::defaultUnit()) << " "
|
||||
<< s1.valueRoundedWithUnit(CSpeedUnit::NM_h());
|
||||
out << s2 << " " << s3 << Qt::endl;
|
||||
|
||||
CAngle a1(180, CAngleUnit::deg());
|
||||
@@ -94,13 +99,15 @@ namespace swift::sample
|
||||
out << w1 << " " << w1.valueRoundedWithUnit(CMassUnit::kg()) << " " << w2 << Qt::endl;
|
||||
|
||||
CPressure p1(CAltitude::standardISASeaLevelPressure());
|
||||
out << p1 << " " << p1.valueRoundedWithUnit(CPressureUnit::psi()) << " " << p1.valueRoundedWithUnit(CPressureUnit::inHg()) << Qt::endl;
|
||||
out << p1 << " " << p1.valueRoundedWithUnit(CPressureUnit::psi()) << " "
|
||||
<< p1.valueRoundedWithUnit(CPressureUnit::inHg()) << Qt::endl;
|
||||
|
||||
CTemperature t1;
|
||||
CTemperature t2(20, CTemperatureUnit::C());
|
||||
CTemperature t3(1, CTemperatureUnit::F());
|
||||
out << t1 << " " << t2 << " " << t2.valueRoundedWithUnit(CTemperatureUnit::defaultUnit(), -1, true);
|
||||
out << t3.valueRoundedWithUnit(CTemperatureUnit::F(), -1, true) << " " << t3.valueRoundedWithUnit(CTemperatureUnit::C(), -1, true) << " "
|
||||
out << t3.valueRoundedWithUnit(CTemperatureUnit::F(), -1, true) << " "
|
||||
<< t3.valueRoundedWithUnit(CTemperatureUnit::C(), -1, true) << " "
|
||||
<< "I18N/UTF" << Qt::endl;
|
||||
|
||||
(t1 - t2).switchUnit(CTemperatureUnit::F()); // was not working since wrong return type const
|
||||
|
||||
Reference in New Issue
Block a user