Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+61
-61
@@ -83,8 +83,8 @@ void UnitTestTrajectory::test_duration()
|
||||
|
||||
posEnd = LtsUtils::QPoint3D(10000, 0, 0);
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, posEnd, heightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
QVERIFY2(qFuzzyCompare(duration, 28.55686245854129), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 21.80338497797008), "beta failed");
|
||||
QVERIFY2(qFuzzyCompare(vOut, 377.1213082434484), "v failed");
|
||||
@@ -93,8 +93,8 @@ void UnitTestTrajectory::test_duration()
|
||||
posEnd = LtsUtils::QPoint3D(10000, 0, 10);
|
||||
// ^^
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, posEnd, heightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
QVERIFY2(qFuzzyCompare(duration, 28.48529092398576), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 21.75384726032234), "beta failed");
|
||||
QVERIFY2(qFuzzyCompare(vOut, 377.9382777961657), "v failed");
|
||||
@@ -130,8 +130,8 @@ void UnitTestTrajectory::test_calcDuration()
|
||||
double duration;
|
||||
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", posEnd " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", posEnd " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration, 4.515236409857309), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 45), "beta failed");
|
||||
@@ -149,15 +149,15 @@ void UnitTestTrajectory::test_calcDuration2()
|
||||
for (peakHeightAbs = 5; peakHeightAbs < 12; ++peakHeightAbs)
|
||||
{
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
}
|
||||
|
||||
{ // Low
|
||||
peakHeightAbs = 8;
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration, 2.554203427256403), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 17.74467162505693), "beta failed"); // 18.9 ??
|
||||
@@ -167,14 +167,14 @@ void UnitTestTrajectory::test_calcDuration2()
|
||||
for (peakHeightAbs = 71; peakHeightAbs < 79; ++peakHeightAbs)
|
||||
{
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
}
|
||||
{ // High
|
||||
peakHeightAbs = 73;
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] = " << std::setprecision(16) << duration << ", beta [deg] = " << betaOut * rad2deg() << ", v = " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] = " << std::setprecision(16) << duration << ", beta [deg] = " << betaOut * rad2deg() << ", v = " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration, 7.715639359362986), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 71.09542415738834), "beta failed");
|
||||
@@ -195,8 +195,8 @@ void UnitTestTrajectory::test_calcPeak()
|
||||
double peakHeightAbs;
|
||||
|
||||
peakHeightAbs = TrajectoryHelper::peakHeightAbs(posStart, endPos, time, &betaOut, &vOut);
|
||||
INFO_LOG() << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW";
|
||||
INFO_LOG() << " -> peakHeightAbs " << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW";
|
||||
INFO_LOG(m_logger) << " -> peakHeightAbs " << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(peakHeightAbs, 25), "peakHeight failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 45), "beta failed");
|
||||
@@ -215,8 +215,8 @@ void UnitTestTrajectory::test_calcPeak2()
|
||||
double peakHeightAbs;
|
||||
|
||||
peakHeightAbs = TrajectoryHelper::peakHeightAbs(posStart, endPos, time, &betaOut, &vOut);
|
||||
INFO_LOG() << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW";
|
||||
INFO_LOG() << " -> peakHeightAbs " << std::setprecision(16) << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW";
|
||||
INFO_LOG(m_logger) << " -> peakHeightAbs " << std::setprecision(16) << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
// eightAbs 122.625, beta [deg] 78.47682271026333, v 50.0589902015612 (ctory/trajectory_unit_test.cpp:178)
|
||||
QVERIFY2(qFuzzyCompare(peakHeightAbs, 122.625), "peakHeight failed");
|
||||
@@ -241,13 +241,13 @@ void UnitTestTrajectory::test_calcPeak3_continuity()
|
||||
const int flightDurationMax = 50;
|
||||
const int flightDurationIncrement = 1;
|
||||
|
||||
INFO_LOG() << "peakHeight with posStart " << posStart << ", posEnd " << endPos;
|
||||
INFO_LOG(m_logger) << "peakHeight with posStart " << posStart << ", posEnd " << endPos;
|
||||
|
||||
for (int curFD = flightDurationMin; curFD <= flightDurationMax; curFD += flightDurationIncrement)
|
||||
{
|
||||
double time = curFD;
|
||||
peakHeightAbs = TrajectoryHelper::peakHeightAbs(posStart, endPos, time, &betaOut, &vOut);
|
||||
INFO_LOG() << " time=" << time << " -> peakHeightAbs=" << std::setprecision(5) << std::setw(10) << std::setfill(' ') << peakHeightAbs << ", beta [deg]=" << betaOut * rad2deg() << ", v=" << std::setw(5) << vOut;
|
||||
INFO_LOG(m_logger) << " time=" << time << " -> peakHeightAbs=" << std::setprecision(5) << std::setw(10) << std::setfill(' ') << peakHeightAbs << ", beta [deg]=" << betaOut * rad2deg() << ", v=" << std::setw(5) << vOut;
|
||||
} // for
|
||||
}
|
||||
|
||||
@@ -346,20 +346,20 @@ void UnitTestTrajectory::test_calcDuration_realistic40km()
|
||||
double duration;
|
||||
int peakHeightAbs;
|
||||
|
||||
INFO_LOG() << "Loop: START";
|
||||
INFO_LOG(m_logger) << "Loop: START";
|
||||
for (peakHeightAbs = 500; peakHeightAbs <= 3000; peakHeightAbs+=250)
|
||||
{
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "Loop: flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "Loop: flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
}
|
||||
INFO_LOG() << "Loop: END";
|
||||
INFO_LOG(m_logger) << "Loop: END";
|
||||
|
||||
// Als realistisch stugen wir mal eine Geschwindigkeit von 1000m/s ein:
|
||||
peakHeightAbs = 2000;
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "explicit; flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "explicit; flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration, 40.38550218769218 ), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 11.30993247402021), "beta failed");
|
||||
@@ -380,8 +380,8 @@ void UnitTestTrajectory::test_calcDuration_differentDistances()
|
||||
// 1000m
|
||||
{
|
||||
duration1 = TrajectoryHelper::flightDurationSec(posStart, endPos1, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos1 << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration1 [sec] " << std::setprecision(16) << duration1 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos1 << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration1 [sec] " << std::setprecision(16) << duration1 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration1, 10.01527884771829), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 26.19718605846828), "beta failed");
|
||||
@@ -391,8 +391,8 @@ void UnitTestTrajectory::test_calcDuration_differentDistances()
|
||||
// 2000m
|
||||
{
|
||||
duration2 = TrajectoryHelper::flightDurationSec(posStart, endPos2, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos2 << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration2 [sec] " << std::setprecision(16) << duration2 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos2 << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration2 [sec] " << std::setprecision(16) << duration2 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration2, 10.01527884771829), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 13.82033952701046), "beta failed");
|
||||
@@ -403,8 +403,8 @@ void UnitTestTrajectory::test_calcDuration_differentDistances()
|
||||
// 2000m, 99m
|
||||
{
|
||||
duration3 = TrajectoryHelper::flightDurationSec(posStart, endPos3, peakHeightAbs, &betaOut, &vOut);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos3 << ", peakHeight " << peakHeightAbs;
|
||||
INFO_LOG() << " -> duration3 [sec] " << std::setprecision(16) << duration3 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos3 << ", peakHeight " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> duration3 [sec] " << std::setprecision(16) << duration3 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration3, 7.219644478296471 ), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 10.05585466470648 ), "beta failed");
|
||||
@@ -438,9 +438,9 @@ void UnitTestTrajectory::test_calcDuration_downToZero()
|
||||
|
||||
peakHeightAbs = 123;
|
||||
duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut, &reason);
|
||||
INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG() << " -> reason '" << reason << "'";
|
||||
INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs;
|
||||
INFO_LOG(m_logger) << " -> reason '" << reason << "'";
|
||||
INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(duration, 7.347880052033394), "flightDurationSec failed");
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 14.18247037775737), "beta failed"); // 18.9 ??
|
||||
@@ -509,7 +509,7 @@ void UnitTestTrajectory::test_realStartPoint()
|
||||
|
||||
LtsUtils::QPoint3D realStartPoint = TrajectoryHelper::realStartPoint(apo, idealHit);
|
||||
|
||||
ERROR_LOG() << " apo = " << apo << " idealHit = " << idealHit << " -> = realStartPoint =" << realStartPoint;
|
||||
ERROR_LOG(m_logger) << " apo = " << apo << " idealHit = " << idealHit << " -> = realStartPoint =" << realStartPoint;
|
||||
QVERIFY2(qFuzzyCompare(realStartPoint, result), "realStartPoint failed");
|
||||
|
||||
// next step:
|
||||
@@ -517,8 +517,8 @@ void UnitTestTrajectory::test_realStartPoint()
|
||||
double duration;
|
||||
const double heightAbs = apo.z();
|
||||
duration = TrajectoryHelper::flightDurationSec(realStartPoint, idealHit, heightAbs, &betaOut, &vOut);
|
||||
ERROR_LOG() << "flightDurationSec with realStartPoint " << realStartPoint << ", idealHit " << idealHit << ", heightAbs " << heightAbs;
|
||||
ERROR_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
ERROR_LOG(m_logger) << "flightDurationSec with realStartPoint " << realStartPoint << ", idealHit " << idealHit << ", heightAbs " << heightAbs;
|
||||
ERROR_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), betaDeg), "flightDurationSec failed");
|
||||
}
|
||||
@@ -581,18 +581,18 @@ void UnitTestTrajectory::test_generateTrajectoryBiedziak()
|
||||
// check Scheitelpunkt / Apogaeum
|
||||
{
|
||||
const auto &item35 = trajectoryOut[35];
|
||||
INFO_LOG() << "iqtem35 = " << item35;
|
||||
INFO_LOG(m_logger) << "iqtem35 = " << item35;
|
||||
QVERIFY2(qFuzzyCompare(item35.z(), 148.044675655973), "TrajectoryGenerator::trajectoryOut failed");
|
||||
}
|
||||
{
|
||||
// Hier ist der Scheitelpunkt:
|
||||
const auto &item36 = trajectoryOut[36];
|
||||
INFO_LOG() << "item36 = " << item36;
|
||||
INFO_LOG(m_logger) << "item36 = " << item36;
|
||||
QVERIFY2(qFuzzyCompare(item36.z(), 148.087567297406), "TrajectoryGenerator::trajectoryOut failed");
|
||||
}
|
||||
{
|
||||
const auto &item37 = trajectoryOut[37];
|
||||
INFO_LOG() << "item37 = " << item37;
|
||||
INFO_LOG(m_logger) << "item37 = " << item37;
|
||||
QVERIFY2(qFuzzyCompare(item37.z(), 147.905786767084), "TrajectoryGenerator::trajectoryOut failed");
|
||||
}
|
||||
}
|
||||
@@ -611,8 +611,8 @@ void UnitTestTrajectory::test_vulcano_beta_Abschusswinkel()
|
||||
const double betaRad = XY::calculateBetaRad(v0, height);
|
||||
const double betaDeg = betaRad * LtsCoordTrans::rad2deg();
|
||||
|
||||
INFO_LOG() << "calculateBetaRad with v0 = " << v0 << ", height = " << height;
|
||||
INFO_LOG() << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg;
|
||||
INFO_LOG(m_logger) << "calculateBetaRad with v0 = " << v0 << ", height = " << height;
|
||||
INFO_LOG(m_logger) << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(betaDeg, 29.99727415506499), "calculateBetaRad failed");
|
||||
}
|
||||
@@ -644,13 +644,13 @@ void UnitTestTrajectory::test_vulcano_apogaeumCosmos()
|
||||
const double betaRad = XY::calculateBetaRad(v0, height);
|
||||
const double betaDeg = betaRad * LtsCoordTrans::rad2deg();
|
||||
|
||||
INFO_LOG() << "calculateBetaRad with v0 = " << v0 << ", height = " << height;
|
||||
INFO_LOG() << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg;
|
||||
INFO_LOG(m_logger) << "calculateBetaRad with v0 = " << v0 << ", height = " << height;
|
||||
INFO_LOG(m_logger) << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg;
|
||||
|
||||
const QPointF &apo = XY::calculateApogaeum(v0, betaRad);
|
||||
|
||||
INFO_LOG() << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg;
|
||||
INFO_LOG() << " -> apo " << apo;
|
||||
INFO_LOG(m_logger) << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg;
|
||||
INFO_LOG(m_logger) << " -> apo " << apo;
|
||||
|
||||
QVERIFY2(qFuzzyCompare(apo.x(), 50 ), "calculateBetaRad/calculateApogaeum failed"); // 100m / 2.0
|
||||
QVERIFY2(qFuzzyCompare(apo.y(), height), "calculateBetaRad/calculateApogaeum failed");
|
||||
@@ -691,15 +691,15 @@ void UnitTestTrajectory::test_vulcano_apogaeum()
|
||||
const QPointF &apo = XY::calculateApogaeum(v0, betaDeg*LtsCoordTrans::deg2rad());
|
||||
|
||||
const QVector2D apoDiff(apo - expectedAPO);
|
||||
DEBUG_LOG() << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg;
|
||||
DEBUG_LOG() << " -> apo " << apo << " diff = "<< apoDiff.length();
|
||||
DEBUG_LOG(m_logger) << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg;
|
||||
DEBUG_LOG(m_logger) << " -> apo " << apo << " diff = "<< apoDiff.length();
|
||||
|
||||
QVERIFY2(apoDiff.length() < 1, "calculateApogaeum failed");
|
||||
|
||||
// und zurück:
|
||||
const double calcBetaRad = XY::calculateBetaRad(v0, expectedAPO.y());
|
||||
double betaDiff = fabs(calcBetaRad*LtsCoordTrans::rad2deg() - betaDeg);
|
||||
DEBUG_LOG() << " zurück: betaDiff = " << betaDiff;
|
||||
DEBUG_LOG(m_logger) << " zurück: betaDiff = " << betaDiff;
|
||||
|
||||
QVERIFY2(betaDiff < 0.001, "calculateBetaRad failed");
|
||||
}
|
||||
@@ -784,15 +784,15 @@ void UnitTestTrajectory::test_vulcano_tap()
|
||||
|
||||
const QPointF &tapRelToImpact = XY::calculateTapRelToIdealHit(vFall, alphaDeg*LtsCoordTrans::deg2rad(), tapT);
|
||||
|
||||
INFO_LOG() << "calculateTapRelToIdealHit with vFall = " << vFall
|
||||
INFO_LOG(m_logger) << "calculateTapRelToIdealHit with vFall = " << vFall
|
||||
<< ", alphaDeg = " << alphaDeg
|
||||
<< ", tapT = " << tapT;
|
||||
INFO_LOG() << " -> tapRelToImpact " << tapRelToImpact
|
||||
INFO_LOG(m_logger) << " -> tapRelToImpact " << tapRelToImpact
|
||||
<< " , lenght = " << QVector2D(tapRelToImpact).length();
|
||||
QVERIFY2((expectedLength - QVector2D(tapRelToImpact).length()) < 1, "calculateTapRelToIdealHit abs failed");
|
||||
|
||||
const QVector2D diff(tapRelToImpact - expectedTAP);
|
||||
INFO_LOG() << " -> diff.QVector2D.length = " << diff.length();
|
||||
INFO_LOG(m_logger) << " -> diff.QVector2D.length = " << diff.length();
|
||||
QVERIFY2(diff.length() < 0.1, "calculateTapRelToIdealHit rel failed");
|
||||
}
|
||||
|
||||
@@ -821,10 +821,10 @@ void UnitTestTrajectory::test_vulcano_ballisticCurve()
|
||||
QFETCH(double, expectedDeltaTime);
|
||||
|
||||
const QPointF &apo = XY::calculateApogaeum(v0, betaDeg*LtsCoordTrans::deg2rad());
|
||||
INFO_LOG() << ", apo " << apo;
|
||||
INFO_LOG(m_logger) << ", apo " << apo;
|
||||
|
||||
const QVector2D diff(apo - expectedAPO);
|
||||
INFO_LOG() << ", diff " << diff.length();
|
||||
INFO_LOG(m_logger) << ", diff " << diff.length();
|
||||
QVERIFY2(diff.length() < 0.1, "calculateApogaeum rel failed");
|
||||
|
||||
//
|
||||
@@ -839,7 +839,7 @@ void UnitTestTrajectory::test_vulcano_ballisticCurve()
|
||||
const QVector<QPointF> &phase1_bal = XY::generateBallisticCurveUntil(v0, betaDeg*LtsCoordTrans::deg2rad(),
|
||||
x_distancePhase1, secPerIntervall,
|
||||
&deltaXperStep_out, &secPerIntervall_out);
|
||||
INFO_LOG() << "generateBallisticCurveUntil: "
|
||||
INFO_LOG(m_logger) << "generateBallisticCurveUntil: "
|
||||
<< ", phase1_bal.size() = " << phase1_bal.size()
|
||||
<< ", phase1_bal.last() = " << std::setprecision(16) << phase1_bal.last()
|
||||
<< ", deltaXperStep_out = " << std::setprecision(16) << deltaXperStep_out
|
||||
@@ -957,10 +957,10 @@ void UnitTestTrajectory::test_vulcano_trajectory()
|
||||
&reasonOut);
|
||||
|
||||
if (!reasonOut.isEmpty())
|
||||
ERROR_LOG() << " trajectoryVulcano failed, reasonOut = '" << reasonOut << "'";
|
||||
ERROR_LOG(m_logger) << " trajectoryVulcano failed, reasonOut = '" << reasonOut << "'";
|
||||
|
||||
|
||||
INFO_LOG() << "trajectoryVulcano: "
|
||||
INFO_LOG(m_logger) << "trajectoryVulcano: "
|
||||
<< ", ret = " << ret
|
||||
<< ", trajectoryOut.size() = " << trajectoryOut.size();
|
||||
|
||||
@@ -968,7 +968,7 @@ void UnitTestTrajectory::test_vulcano_trajectory()
|
||||
QVERIFY2(trajectoryOut.size() == expectedSize, "trajectoryVulcano2 failed");
|
||||
|
||||
// const QPoint3D &apo3D = trajectoryOut[40]; // more or less wellknown
|
||||
// INFO_LOG() << "trajectoryVulcano: "
|
||||
// INFO_LOG(m_logger) << "trajectoryVulcano: "
|
||||
// << ", ret = " << ret
|
||||
// << ", trajectoryOut.size() = " << trajectoryOut.size()
|
||||
// << ", apo3D = " << apo3D;
|
||||
@@ -976,7 +976,7 @@ void UnitTestTrajectory::test_vulcano_trajectory()
|
||||
// // recalculate to distance between apo and origin (on flat xy)
|
||||
// LtsUtils::QPoint3D apoToOrigin = apo3D - origin;
|
||||
// double xyDist = QVector2D(apoToOrigin.toPointF()).length();
|
||||
// INFO_LOG() << " -> apoToOrigin.length = " << std::setprecision(16) << xyDist;
|
||||
// INFO_LOG(m_logger) << " -> apoToOrigin.length = " << std::setprecision(16) << xyDist;
|
||||
|
||||
// QVERIFY2(fabs( 12248.0 - xyDist ) < 1, "generateBallisticCurveUntil3 failed");
|
||||
// QVERIFY2(fabs( 8127.0 + origin.z() - apo3D.z() ) < 1, "generateBallisticCurveUntil4 failed");
|
||||
@@ -993,7 +993,7 @@ void UnitTestTrajectory::test_vulcano_trajectory()
|
||||
|
||||
int i=0;
|
||||
for (auto &item : std::as_const(trajectoryOut))
|
||||
INFO_LOG() << "i = " << i++ << ", item " << item;
|
||||
INFO_LOG(m_logger) << "i = " << i++ << ", item " << item;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
@@ -77,4 +77,6 @@ private Q_SLOTS:
|
||||
// void cleanup();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
+15
-15
@@ -85,22 +85,22 @@ void TrajectoryGenerator::cleanup()
|
||||
|
||||
void TrajectoryGenerator::initElevation(LtsElevation::LtsElevationManager *ltsElevationManager)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
m_ltsElevationManager = ltsElevationManager;
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
LtsElevation::LtsElevationManager *TrajectoryGenerator::getElevationManager()
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
return m_ltsElevationManager;
|
||||
}
|
||||
|
||||
bool TrajectoryGenerator::hasElevationManager() const
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
return m_ltsElevationManager;
|
||||
}
|
||||
|
||||
@@ -268,14 +268,14 @@ bool TrajectoryGenerator::generateTrajectoryBiedziak(const LtsUtils::QPoint3D &o
|
||||
CONT_T &trajectoryOut)
|
||||
{
|
||||
// use zone of impact:
|
||||
INFO_LOG() << " oPosition geo " << originatorPosition_geo.x() << " - " << originatorPosition_geo.y();
|
||||
INFO_LOG() << " iPosition geo " << impactPosition_geo.x() << " - " << impactPosition_geo.y();
|
||||
INFO_LOG(m_logger) << " oPosition geo " << originatorPosition_geo.x() << " - " << originatorPosition_geo.y();
|
||||
INFO_LOG(m_logger) << " iPosition geo " << impactPosition_geo.x() << " - " << impactPosition_geo.y();
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate &iPosition = LtsCoordTrans::UtmCoordinate::fromGeographic(impactPosition_geo.toPointF());
|
||||
const LtsCoordTrans::UtmCoordinate &oPosition = LtsCoordTrans::UtmCoordinate::fromGeographic(originatorPosition_geo.toPointF(), iPosition.zone);
|
||||
|
||||
INFO_LOG() << " oPosition " << oPosition.mgrs();
|
||||
INFO_LOG() << " iPosition " << iPosition.mgrs();
|
||||
INFO_LOG(m_logger) << " oPosition " << oPosition.mgrs();
|
||||
INFO_LOG(m_logger) << " iPosition " << iPosition.mgrs();
|
||||
|
||||
const double distance = sqrt(pow(iPosition.x - oPosition.x, 2.) + pow(iPosition.y - oPosition.y, 2.));
|
||||
|
||||
@@ -287,18 +287,18 @@ bool TrajectoryGenerator::generateTrajectoryBiedziak(const LtsUtils::QPoint3D &o
|
||||
oHeight = m_ltsElevationManager ? m_ltsElevationManager->elevation(originatorPosition_geo.x(), originatorPosition_geo.y()) : 0;
|
||||
if (oHeight < 300)
|
||||
oHeight = 100;
|
||||
INFO_LOG() << " oPosition " << oPosition << " has no zValue provided (NaN), update via ltsElevationManager...";
|
||||
INFO_LOG(m_logger) << " oPosition " << oPosition << " has no zValue provided (NaN), update via ltsElevationManager...";
|
||||
}
|
||||
if (std::isnan(iHeight) && m_ltsElevationManager)
|
||||
{
|
||||
iHeight = m_ltsElevationManager ? m_ltsElevationManager->elevation(impactPosition_geo.x(), impactPosition_geo.y()) : 0;
|
||||
if (iHeight < 300)
|
||||
iHeight = 100;
|
||||
INFO_LOG() << " iPosition " << iPosition << " has no zValue provided (NaN), update via ltsElevationManager.. ";
|
||||
INFO_LOG(m_logger) << " iPosition " << iPosition << " has no zValue provided (NaN), update via ltsElevationManager.. ";
|
||||
}
|
||||
|
||||
INFO_LOG() << " oPosition " << oPosition << " ; oHeight=" << oHeight;
|
||||
INFO_LOG() << " iPosition " << iPosition << " ; iHeight=" << iHeight;
|
||||
INFO_LOG(m_logger) << " oPosition " << oPosition << " ; oHeight=" << oHeight;
|
||||
INFO_LOG(m_logger) << " iPosition " << iPosition << " ; iHeight=" << iHeight;
|
||||
|
||||
// z-Values:
|
||||
const QVector<double> &zValues = this->trajectoryBiedziak(distance, iHeight - oHeight, elevation_angle_degree);
|
||||
@@ -324,7 +324,7 @@ bool TrajectoryGenerator::generateTrajectoryBiedziak(const LtsUtils::QPoint3D &o
|
||||
p2D.x(), p2D.y(), oHeight + zValues[i]); // x, y, z
|
||||
} // for
|
||||
|
||||
//// DEBUG_LOG() << string4poly(geo);
|
||||
//// DEBUG_LOG(m_logger) << string4poly(geo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
@@ -89,6 +89,7 @@ class TRAJECTORY_EXPORT TrajectoryGenerator : public QObject
|
||||
QString *reasonOut);
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
/*! \name Ideal trajectory */
|
||||
template <typename CONT_T>
|
||||
bool generateTrajectoryBiedziak(const LtsUtils::QPoint3D &originatorPosition_geo,
|
||||
@@ -97,6 +98,7 @@ class TRAJECTORY_EXPORT TrajectoryGenerator : public QObject
|
||||
CONT_T &trajectoryOut);
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
explicit TrajectoryGenerator();
|
||||
|
||||
public:
|
||||
|
||||
Reference in new issue
Block a user