Instrument Neutral Distributed Interface INDI 2.2.5
NearestMathPlugin.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2021 Jasem Mutlaq. All rights reserved.
3
4 AstroTrac Mount Driver.
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
9 .
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14 .
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*******************************************************************************/
20
21#pragma once
22
24#include "ConvexHull.h"
25
26namespace INDI
27{
28namespace AlignmentSubsystem
29{
30
96
98{
99 public:
101 virtual ~NearestMathPlugin();
102
103 virtual bool Initialise(InMemoryDatabase *pInMemoryDatabase) override;
104
105 virtual bool TransformCelestialToTelescopeJD(double RightAscension, double Declination,
106 double JulianDate,
107 TelescopeDirectionVector &ApparentTelescopeDirectionVector) override;
108
109 virtual bool TransformTelescopeToCelestialJD(const TelescopeDirectionVector &ApparentTelescopeDirectionVector,
110 double &RightAscension, double &Declination, double JulianDate) override;
111
112 virtual bool TransformCelestialToTelescope(const double RightAscension, const double Declination,
113 double JulianOffset,
114 TelescopeDirectionVector &ApparentTelescopeDirectionVector) override;
115
116 virtual bool TransformTelescopeToCelestial(const TelescopeDirectionVector &ApparentTelescopeDirectionVector,
117 double &RightAscension, double &Declination, double JulianOffset = 0) override;
118
119 private:
120
121 std::vector<ExtendedAlignmentDatabaseEntry> ExtendedAlignmentPoints;
122
131 double SphereUnitDistance(double theta1, double theta2, double phi1, double phi2);
132
141 ExtendedAlignmentDatabaseEntry GetNearestPoint(const double Azimuth, const double Altitude, bool isCelestial);
142};
143
144} // namespace AlignmentSubsystem
145} // namespace INDI
This class encapsulates all the alignment subsystem classes that are useful to math plugin implementa...
This class provides the driver side API to the in memory alignment database.
virtual bool TransformTelescopeToCelestial(const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination, double JulianOffset=0) override
Get the true celestial coordinates for the supplied telescope pointing direction.
virtual bool TransformCelestialToTelescopeJD(double RightAscension, double Declination, double JulianDate, TelescopeDirectionVector &ApparentTelescopeDirectionVector) override
Get the alignment corrected telescope pointing direction for the supplied celestial coordinates.
virtual bool TransformCelestialToTelescope(const double RightAscension, const double Declination, double JulianOffset, TelescopeDirectionVector &ApparentTelescopeDirectionVector) override
Get the alignment corrected telescope pointing direction for the supplied celestial coordinates.
virtual bool TransformTelescopeToCelestialJD(const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination, double JulianDate) override
Get the true celestial coordinates for the supplied telescope pointing direction.
virtual bool Initialise(InMemoryDatabase *pInMemoryDatabase) override
Initialise or re-initialise the math plugin. Re-reading the in memory database as necessary.
Namespace to encapsulate INDI client, drivers, and mediator classes.
Entry in the in memory alignment database.
Definition Common.h:152
double RightAscension
Right ascension in decimal hours. N.B. libnova works in decimal degrees so conversion is always neede...
Definition Common.h:190
TelescopeDirectionVector TelescopeDirection
Normalised vector giving telescope pointing direction. This is referred to elsewhere as the "apparent...
Definition Common.h:197
double Declination
Declination in decimal degrees.
Definition Common.h:193
int PrivateDataSize
This size in bytes of any private data.
Definition Common.h:203
std::unique_ptr< unsigned char > PrivateData
Private data associated with this sync point.
Definition Common.h:200
double CelestialAzimuth
Celestial Azimuth of Sync Point at the time it was added to the list.
double TelescopeAzimuth
Telescope Azimuth of Sync Point at the time it was added to the list.
ExtendedAlignmentDatabaseEntry(const ExtendedAlignmentDatabaseEntry &Source)
Copy constructor.
double TelescopeAltitude
Telescope Altitude of the Sync point at the time it was added to the list.
double CelestialAltitude
Celestial Altitude of the Sync point at the time it was added to the list.
const ExtendedAlignmentDatabaseEntry & operator=(const ExtendedAlignmentDatabaseEntry &RHS)
Override the assignment operator to provide a const version.
Holds a normalised direction vector (direction cosines)
Definition Common.h:69