13 namespace AlignmentSubsystem
34 int blobsizes[],
char *blobs[],
char *formats[],
42 double values[],
char *names[],
int n)
48 ISState *states,
char *names[],
int n)
55 char *texts[],
char *names[],
int n)
109 mountDec = actualDec;
122 mountRA =
eq.rightascension;
123 mountDec =
eq.declination;
139 actualDec = mountDec;
149 eq.rightascension = mountRA;
150 eq.declination = mountDec;
209 mountAlt =
range360(altAz.altitude);
231 altaz.altitude =
range360(mountAlt);
241 void AlignmentSubsystemForDrivers::MyDatabaseLoadCallback(
void *ThisPointer)
This class encapsulates all the alignment subsystem classes that are useful to driver implementations...
bool SkyToTelescopeEquatorial(double actualRA, double actualDec, double &mountRA, double &mountDec)
Converts an actual sky location to coordinates to send to the mount, usually called in Goto.
bool TelescopeEquatorialToSky(double mountRA, double mountDec, double &actualRA, double &actualDec)
Converts a mount location to actual sky coordinates, usually called in ReadScopeStatus.
void ProcessAlignmentNumberProperties(Telescope *pTelescope, const char *name, double values[], char *names[], int n)
Call this function from within the ISNewNumber processing path. The function will handle any alignmen...
bool AddAlignmentEntryAltAz(double actualRA, double actualDec, double mountAlt, double mountAz)
Adds an alignment point to the model database, usually called from Sync.
void ProcessAlignmentSwitchProperties(Telescope *pTelescope, const char *name, ISState *states, char *names[], int n)
Call this function from within the ISNewSwitch processing path. The function will handle any alignmen...
bool TelescopeAltAzToSky(double mountAlt, double mountAz, double &actualRA, double &actualDec)
Converts a mount location to actual sky coordinates, usually called in ReadScopeStatus.
bool SkyToTelescopeAltAz(double actualRA, double actualDec, double &mountAlt, double &mountAz)
Converts an actual sky location to coordinates to send to the mount, usually called in Goto.
void InitAlignmentProperties(Telescope *pTelescope)
Initilize alignment subsystem properties. It is recommended to call this function within initProperti...
AlignmentSubsystemForDrivers()
Default constructor.
void ProcessAlignmentBLOBProperties(Telescope *pTelescope, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
Call this function from within the ISNewBlob processing path. The function will handle any alignment ...
void SaveAlignmentConfigProperties(FILE *fp)
Call this function to save persistent alignment related properties. This function should be called fr...
void ProcessAlignmentTextProperties(Telescope *pTelescope, const char *name, char *texts[], char *names[], int n)
Call this function from within the ISNewText processing path. The function will handle any alignment ...
bool AddAlignmentEntryEquatorial(double actualRA, double actualDec, double mountRA, double mountDec)
Adds an alignment point to the model database, usually called from Sync.
AlignmentDatabaseType & GetAlignmentDatabase()
Get a reference to the in memory database.
void SetLoadDatabaseCallback(LoadDatabaseCallbackPointer_t CallbackPointer, void *ThisPointer)
Set the function to be called when the database is loaded or reloaded.
bool CheckForDuplicateSyncPoint(const AlignmentDatabaseEntry &CandidateEntry, double Tolerance=0.1) const
Check if a entry already exists in the database.
bool GetDatabaseReferencePosition(IGeographicCoordinates &Position)
Get the database reference position.
void ProcessNumberProperties(Telescope *, const char *name, double values[], char *names[], int n)
Call this function from within the ISNewNumber processing path. The function will handle any alignmen...
void InitProperties(Telescope *pTelescope)
Initialize alignment database properties. It is recommended to call this function within initProperti...
void UpdateSize()
Call this function when the number of entries in the database changes.
void ProcessBlobProperties(Telescope *pTelescope, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
Call this function from within the ISNewBLOB processing path. The function will handle any alignment ...
void ProcessSwitchProperties(Telescope *pTelescope, const char *name, ISState *states, char *names[], int n)
Call this function from within the ISNewSwitch processing path. The function will handle any alignmen...
void ProcessSwitchProperties(Telescope *pTelescope, const char *name, ISState *states, char *names[], int n)
Call this function from within the ISNewSwitch processing path. The function will handle any math plu...
bool TransformTelescopeToCelestial(const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination)
TransformTelescopeToCelestial Transforms Mount Coords to Celestial (Sky) Coordinates.
void InitProperties(Telescope *pTelescope)
Initialize alignment math plugin properties. It is recommended to call this function within initPrope...
void SaveConfigProperties(FILE *fp)
Call this function to save persistent math plugin properties. This function should be called from wit...
void SetCurrentInMemoryDatabase(InMemoryDatabase *pDatabase)
Set the current in memory database.
void ProcessTextProperties(Telescope *pTelescope, const char *name, char *texts[], char *names[], int n)
Call this function from within the ISNewText processing path. The function will handle any math plugi...
bool TransformCelestialToTelescope(const double RightAscension, const double Declination, double JulianOffset, TelescopeDirectionVector &ApparentTelescopeDirectionVector)
TransformCelestialToTelescope Transforms Celestial (Sky) Coords to Mount Coordinates.
bool Initialise(InMemoryDatabase *pInMemoryDatabase)
Initialise or re-initialise the math plugin. Re-reading the in memory database as necessary.
const TelescopeDirectionVector TelescopeDirectionVectorFromAltitudeAzimuth(INDI::IHorizontalCoordinates HorizontalCoordinates)
Calculates a normalised direction vector from the supplied altitude and azimuth.
void EquatorialCoordinatesFromTelescopeDirectionVector(const TelescopeDirectionVector TelescopeDirectionVector, INDI::IEquatorialCoordinates &EquatorialCoordinates)
Calculates equatorial coordinates from the supplied telescope direction vector and declination.
const TelescopeDirectionVector TelescopeDirectionVectorFromEquatorialCoordinates(INDI::IEquatorialCoordinates EquatorialCoordinates)
Calculates a telescope direction vector from the supplied equatorial coordinates.
void AltitudeAzimuthFromTelescopeDirectionVector(const TelescopeDirectionVector TelescopeDirectionVector, INDI::IHorizontalCoordinates &HorizontalCoordinates)
Calculates an altitude and azimuth from the supplied normalised direction vector and declination.
double range360(double r)
range360 Limits an angle to be between 0-360 degrees.
Namespace to encapsulate INDI client, drivers, and mediator classes.
Entry in the in memory alignment database.
double RightAscension
Right ascension in decimal hours. N.B. libnova works in decimal degrees so conversion is always neede...
double ObservationJulianDate
TelescopeDirectionVector TelescopeDirection
Normalised vector giving telescope pointing direction. This is referred to elsewhere as the "apparent...
double Declination
Declination in decimal degrees.
int PrivateDataSize
This size in bytes of any private data.
Holds a nomalised direction vector (direction cosines)