Changeset View
Changeset View
Standalone View
Standalone View
Tests/kstars_ui/test_ekos_simulator.cpp
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
47 | void TestEkosSimulator::cleanup() | 47 | void TestEkosSimulator::cleanup() | ||
48 | { | 48 | { | ||
49 | 49 | | |||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | 52 | | |||
53 | void TestEkosSimulator::testMountSlew_data() | 53 | void TestEkosSimulator::testMountSlew_data() | ||
54 | { | 54 | { | ||
55 | #if QT_VERSION < 0x050900 | ||||
56 | QSKIP("Skipping fixture-based test on old QT version."); | ||||
57 | #else | ||||
55 | QTest::addColumn<QString>("NAME"); | 58 | QTest::addColumn<QString>("NAME"); | ||
56 | QTest::addColumn<QString>("RA"); | 59 | QTest::addColumn<QString>("RA"); | ||
57 | QTest::addColumn<QString>("DEC"); | 60 | QTest::addColumn<QString>("DEC"); | ||
58 | 61 | | |||
59 | // Altitude computation taken from SchedulerJob::findAltitude | 62 | // Altitude computation taken from SchedulerJob::findAltitude | ||
60 | GeoLocation * const geo = KStarsData::Instance()->geo(); | 63 | GeoLocation * const geo = KStarsData::Instance()->geo(); | ||
61 | KStarsDateTime const now(KStarsData::Instance()->lt()); | 64 | KStarsDateTime const now(KStarsData::Instance()->lt()); | ||
62 | KSNumbers const numbers(now.djd()); | 65 | KSNumbers const numbers(now.djd()); | ||
Show All 11 Lines | 74 | { | |||
74 | o.EquatorialToHorizontal(&LST, geo->lat()); | 77 | o.EquatorialToHorizontal(&LST, geo->lat()); | ||
75 | if (5.0 < so->alt().Degrees()) | 78 | if (5.0 < so->alt().Degrees()) | ||
76 | QTest::addRow("%s", name.toStdString().c_str()) | 79 | QTest::addRow("%s", name.toStdString().c_str()) | ||
77 | << name | 80 | << name | ||
78 | << so->ra().toHMSString() | 81 | << so->ra().toHMSString() | ||
79 | << so->dec().toDMSString(); | 82 | << so->dec().toDMSString(); | ||
80 | } | 83 | } | ||
81 | } | 84 | } | ||
85 | #endif | ||||
82 | } | 86 | } | ||
83 | 87 | | |||
84 | void TestEkosSimulator::testMountSlew() | 88 | void TestEkosSimulator::testMountSlew() | ||
85 | { | 89 | { | ||
90 | #if QT_VERSION < 0x050900 | ||||
91 | QSKIP("Skipping fixture-based test on old QT version."); | ||||
92 | #else | ||||
86 | Ekos::Manager * const ekos = Ekos::Manager::Instance(); | 93 | Ekos::Manager * const ekos = Ekos::Manager::Instance(); | ||
87 | 94 | | |||
88 | QFETCH(QString, NAME); | 95 | QFETCH(QString, NAME); | ||
89 | QFETCH(QString, RA); | 96 | QFETCH(QString, RA); | ||
90 | QFETCH(QString, DEC); | 97 | QFETCH(QString, DEC); | ||
91 | qDebug("Test slewing to '%s' RA '%s' DEC '%s'", | 98 | qDebug("Test slewing to '%s' RA '%s' DEC '%s'", | ||
92 | NAME.toStdString().c_str(), | 99 | NAME.toStdString().c_str(), | ||
93 | RA.toStdString().c_str(), | 100 | RA.toStdString().c_str(), | ||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 138 | #endif | |||
144 | QLineEdit * deOut = Ekos::Manager::Instance()->findChild<QLineEdit*>("decOUT"); | 151 | QLineEdit * deOut = Ekos::Manager::Instance()->findChild<QLineEdit*>("decOUT"); | ||
145 | QVERIFY(deOut != nullptr); | 152 | QVERIFY(deOut != nullptr); | ||
146 | QTRY_VERIFY_WITH_TIMEOUT(abs(clampDE(DEC) - clampDE(deOut->text())) < 2, 15000); | 153 | QTRY_VERIFY_WITH_TIMEOUT(abs(clampDE(DEC) - clampDE(deOut->text())) < 2, 15000); | ||
147 | QTest::qWait(100); | 154 | QTest::qWait(100); | ||
148 | if (clampRA(DEC) != clampRA(deOut->text())) | 155 | if (clampRA(DEC) != clampRA(deOut->text())) | ||
149 | QWARN(QString("Target '%1' slewed to with coordinate offset DEC %2").arg(NAME).arg(DEC).toStdString().c_str()); | 156 | QWARN(QString("Target '%1' slewed to with coordinate offset DEC %2").arg(NAME).arg(DEC).toStdString().c_str()); | ||
150 | 157 | | |||
151 | QVERIFY(Ekos::Manager::Instance()->mountModule()->abort()); | 158 | QVERIFY(Ekos::Manager::Instance()->mountModule()->abort()); | ||
159 | #endif | ||||
152 | } | 160 | } | ||
153 | 161 | | |||
162 | | ||||
154 | #endif | 163 | #endif |