mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-11 12:15:36 +08:00
style and consistency:
* rename CStatusMessages to CStatusMessageList * rename NetworkVatlib to CNetworkVatlib * replace all occurrences of Realname with RealName (correct camel case) * CSequence method corresponding to CList::append is push_back * don't compile the qdbuscpp2xml metadata plugin by default * CAircraftIcao string members always trimmed and capitalized * added CComSystem::roundTo25KHz * using epsilon comparison in a couple of places refs #81
This commit is contained in:
committed by
Mathew Sutcliffe
parent
b5c3a5543f
commit
bb61654a29
@@ -2,33 +2,35 @@
|
||||
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Math;
|
||||
|
||||
|
||||
namespace BlackMiscTest
|
||||
{
|
||||
|
||||
/*
|
||||
* Geo classes tests
|
||||
*/
|
||||
void CTestGeo::geoBasics()
|
||||
{
|
||||
CLatitude lati(10, CAngleUnit::deg());
|
||||
QVERIFY2(lati * 2 == lati + lati, "Latitude addition should be equal");
|
||||
lati += CLatitude(20, CAngleUnit::deg());
|
||||
QVERIFY2(lati.valueRounded() == 30.0, "Latitude should be 30 degrees");
|
||||
/*
|
||||
* Geo classes tests
|
||||
*/
|
||||
void CTestGeo::geoBasics()
|
||||
{
|
||||
CLatitude lati(10, CAngleUnit::deg());
|
||||
QVERIFY2(lati * 2 == lati + lati, "Latitude addition should be equal");
|
||||
lati += CLatitude(20, CAngleUnit::deg());
|
||||
QVERIFY2(lati.valueRounded() == 30.0, "Latitude should be 30 degrees");
|
||||
|
||||
double lat = 27.999999, lon = 86.999999, h = 8820.999999; // Mt Everest
|
||||
CCoordinateGeodetic startGeoVec(lat, lon, h);
|
||||
CCoordinateEcef mediumEcefVec = CCoordinateTransformation::toEcef(startGeoVec);
|
||||
CCoordinateGeodetic endGeoVec = CCoordinateTransformation::toGeodetic(mediumEcefVec);
|
||||
double lat = 27.999999, lon = 86.999999, h = 8820.999999; // Mt Everest
|
||||
CCoordinateGeodetic startGeoVec(lat, lon, h);
|
||||
CCoordinateEcef mediumEcefVec = CCoordinateTransformation::toEcef(startGeoVec);
|
||||
CCoordinateGeodetic endGeoVec = CCoordinateTransformation::toGeodetic(mediumEcefVec);
|
||||
|
||||
// this == contains some implicit rounding, since it is based on PQs
|
||||
QVERIFY2(startGeoVec == endGeoVec, "Reconverted geo vector should be equal ");
|
||||
// this == contains some implicit rounding, since it is based on PQs
|
||||
QVERIFY2(startGeoVec == endGeoVec, "Reconverted geo vector should be equal ");
|
||||
|
||||
CCoordinateNed nedVec = CCoordinateTransformation::toNed(mediumEcefVec, startGeoVec);
|
||||
CCoordinateEcef ecefReconvert = CCoordinateTransformation::toEcef(nedVec);
|
||||
CCoordinateNed nedVec = CCoordinateTransformation::toNed(mediumEcefVec, startGeoVec);
|
||||
CCoordinateEcef ecefReconvert = CCoordinateTransformation::toEcef(nedVec);
|
||||
|
||||
// check against rounded reconvert
|
||||
QVERIFY2(mediumEcefVec.rounded() == ecefReconvert.rounded(), "Reconverted geo vector should be equal");
|
||||
}
|
||||
// check against rounded reconvert
|
||||
QVERIFY2(mediumEcefVec.rounded() == ecefReconvert.rounded(), "Reconverted geo vector should be equal");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user