File indexing completed on 2024-04-28 07:33:11
0001 /* 0002 SPDX-FileCopyrightText: 2021 Hy Murveit <hy@murveit.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QTest> 0010 #include <QDebug> 0011 #include <QString> 0012 0013 #define UNIT_TEST 0014 0015 #include "../../kstars/ekos/align/poleaxis.h" 0016 #include "../../kstars/ekos/align/polaralign.h" 0017 0018 /** 0019 * @class TestPolarAlign 0020 * @short Tests for the PolarAlign class. 0021 * @author Hy Murveit 0022 */ 0023 0024 class TestPolarAlign : public QObject 0025 { 0026 Q_OBJECT 0027 0028 public: 0029 TestPolarAlign(); 0030 ~TestPolarAlign() override; 0031 0032 private slots: 0033 void testRunPAA(); 0034 void testRefreshCoords(); 0035 void testAlt(); 0036 void testRotate(); 0037 void testRotate_data(); 0038 0039 private: 0040 void compare(double a, double e, QString msg, int line, double tolerance = 0.0003); 0041 bool compare(const QPointF &point, double x, double y, double tolerance = 0.0001); 0042 0043 void getAzAlt(const KStarsDateTime &time, const GeoLocation &geo, 0044 const QPointF &pixel, double ra, double dec, double orientation, 0045 double pixScale, double *az, double *alt); 0046 0047 };