Instrument Neutral Distributed Interface INDI  2.0.2
Public Member Functions | List of all members
INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers Class Reference

This class encapsulates all the alignment subsystem classes that are useful to driver implementations. Drivers should inherit from this class. More...

#include <AlignmentSubsystemForDrivers.h>

Inheritance diagram for INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers:
INDI::AlignmentSubsystem::MapPropertiesToInMemoryDatabase INDI::AlignmentSubsystem::MathPluginManagement INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions INDI::AlignmentSubsystem::InMemoryDatabase INDI::AlignmentSubsystem::MathPlugin AstroTrac DSC Scope ScopeSim SkywatcherAPIMount

Public Member Functions

 AlignmentSubsystemForDrivers ()
 Default constructor. More...
 
virtual ~AlignmentSubsystemForDrivers ()
 Virtual destructor. More...
 
void InitAlignmentProperties (Telescope *pTelescope)
 Initilize alignment subsystem properties. It is recommended to call this function within initProperties() of your primary device. More...
 
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 subsystem related properties. More...
 
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 alignment subsystem related properties. More...
 
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 alignment subsystem related properties. More...
 
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 subsystem related properties. This only text property at the moment is contained in the config file so this will normally only have work to do when the config file is loaded. More...
 
void SaveAlignmentConfigProperties (FILE *fp)
 Call this function to save persistent alignment related properties. This function should be called from within the saveConfigItems function of your driver. More...
 
bool AddAlignmentEntryEquatorial (double actualRA, double actualDec, double mountRA, double mountDec)
 Adds an alignment point to the model database, usually called from Sync. More...
 
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. More...
 
bool TelescopeEquatorialToSky (double mountRA, double mountDec, double &actualRA, double &actualDec)
 Converts a mount location to actual sky coordinates, usually called in ReadScopeStatus. More...
 
bool AddAlignmentEntryAltAz (double actualRA, double actualDec, double mountAlt, double mountAz)
 Adds an alignment point to the model database, usually called from Sync. More...
 
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. More...
 
bool TelescopeAltAzToSky (double mountAlt, double mountAz, double &actualRA, double &actualDec)
 Converts a mount location to actual sky coordinates, usually called in ReadScopeStatus. More...
 
- Public Member Functions inherited from INDI::AlignmentSubsystem::MapPropertiesToInMemoryDatabase
virtual ~MapPropertiesToInMemoryDatabase ()
 Virtual destructor. More...
 
void InitProperties (Telescope *pTelescope)
 Initialize alignment database properties. It is recommended to call this function within initProperties() of your primary device. More...
 
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 database related properties. More...
 
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 alignment database related properties. More...
 
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 alignment database related properties. More...
 
void UpdateLocation (double latitude, double longitude, double elevation)
 Call this function from within the updateLocation processing path. More...
 
void UpdateSize ()
 Call this function when the number of entries in the database changes. More...
 
- Public Member Functions inherited from INDI::AlignmentSubsystem::InMemoryDatabase
 InMemoryDatabase ()
 Default constructor. More...
 
virtual ~InMemoryDatabase ()
 Virtual destructor. More...
 
bool CheckForDuplicateSyncPoint (const AlignmentDatabaseEntry &CandidateEntry, double Tolerance=0.1) const
 Check if a entry already exists in the database. More...
 
void RemoveSyncPoint (const AlignmentDatabaseEntry &CandidateEntry, double Tolerance=0.1)
 Remove a sync point that falls within the tolerance of a candidate point. More...
 
AlignmentDatabaseTypeGetAlignmentDatabase ()
 Get a reference to the in memory database. More...
 
bool GetDatabaseReferencePosition (IGeographicCoordinates &Position)
 Get the database reference position. More...
 
bool LoadDatabase (const char *DeviceName)
 Load the database from persistent storage. More...
 
bool SaveDatabase (const char *DeviceName)
 Save the database to persistent storage. More...
 
void SetDatabaseReferencePosition (double Latitude, double Longitude)
 Set the database reference position. More...
 
void SetLoadDatabaseCallback (LoadDatabaseCallbackPointer_t CallbackPointer, void *ThisPointer)
 Set the function to be called when the database is loaded or reloaded. More...
 
- Public Member Functions inherited from INDI::AlignmentSubsystem::MathPluginManagement
 MathPluginManagement ()
 Default constructor. More...
 
virtual ~MathPluginManagement ()
 Virtual destructor. More...
 
void InitProperties (Telescope *pTelescope)
 Initialize alignment math plugin properties. It is recommended to call this function within initProperties() of your primary device. More...
 
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 plugin switch properties. More...
 
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 plugin text properties. This text property is at the moment only contained in the config file so this will normally only have work to do when the config file is loaded. More...
 
void SaveConfigProperties (FILE *fp)
 Call this function to save persistent math plugin properties. This function should be called from within the saveConfigItems function of your driver. More...
 
void SetApproximateMountAlignmentFromMountType (MountType_t Type)
 Call this function to set the ApproximateMountAlignment property of the current Math Plugin. The alignment database should be initialised before this function is called so that it can use the DatabaseReferencePosition to determine which hemisphere the current observing site is in. For equatorial the ApproximateMountAlignment property will set to NORTH_CELESTIAL_POLE for sites in the northern hemisphere and SOUTH_CELESTIAL_POLE for sites in the southern hemisphere. For altaz mounts the ApproximateMountAlignment will be set to ZENITH. More...
 
void SetCurrentInMemoryDatabase (InMemoryDatabase *pDatabase)
 Set the current in memory database. More...
 
void SetAlignmentSubsystemActive (bool enable)
 SetAlignmentSubsystemActive Enable or Disable alignment subsystem. More...
 
bool IsAlignmentSubsystemActive () const
 Return status of alignment subsystem. More...
 
MountAlignment_t GetApproximateMountAlignment ()
 Get the approximate alognment of the mount. More...
 
bool Initialise (InMemoryDatabase *pInMemoryDatabase)
 Initialise or re-initialise the math plugin. Re-reading the in memory database as necessary. More...
 
void SetApproximateMountAlignment (MountAlignment_t ApproximateAlignment)
 Set the approximate alognment of the mount. More...
 
bool TransformCelestialToTelescope (const double RightAscension, const double Declination, double JulianOffset, TelescopeDirectionVector &ApparentTelescopeDirectionVector)
 TransformCelestialToTelescope Transforms Celestial (Sky) Coords to Mount Coordinates. More...
 
bool TransformTelescopeToCelestial (const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination)
 TransformTelescopeToCelestial Transforms Mount Coords to Celestial (Sky) Coordinates. More...
 
- Public Member Functions inherited from INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions
virtual ~TelescopeDirectionVectorSupportFunctions ()
 Virtual destructor. More...
 
void AltitudeAzimuthFromTelescopeDirectionVector (const TelescopeDirectionVector TelescopeDirectionVector, INDI::IHorizontalCoordinates &HorizontalCoordinates)
 Calculates an altitude and azimuth from the supplied normalised direction vector and declination. More...
 
void EquatorialCoordinatesFromTelescopeDirectionVector (const TelescopeDirectionVector TelescopeDirectionVector, INDI::IEquatorialCoordinates &EquatorialCoordinates)
 Calculates equatorial coordinates from the supplied telescope direction vector and declination. More...
 
void LocalHourAngleDeclinationFromTelescopeDirectionVector (const TelescopeDirectionVector TelescopeDirectionVector, INDI::IEquatorialCoordinates &EquatorialCoordinates)
 Calculates a local hour angle and declination from the supplied telescope direction vector and declination. More...
 
void SphericalCoordinateFromTelescopeDirectionVector (const TelescopeDirectionVector TelescopeDirectionVector, double &AzimuthAngle, AzimuthAngleDirection_t AzimuthAngleDirection, double &PolarAngle, PolarAngleDirection_t PolarAngleDirection)
 Calculates a spherical coordinate from the supplied telescope direction vector. More...
 
const TelescopeDirectionVector TelescopeDirectionVectorFromAltitudeAzimuth (INDI::IHorizontalCoordinates HorizontalCoordinates)
 Calculates a normalised direction vector from the supplied altitude and azimuth. More...
 
const TelescopeDirectionVector TelescopeDirectionVectorFromEquatorialCoordinates (INDI::IEquatorialCoordinates EquatorialCoordinates)
 Calculates a telescope direction vector from the supplied equatorial coordinates. More...
 
const TelescopeDirectionVector TelescopeDirectionVectorFromLocalHourAngleDeclination (INDI::IEquatorialCoordinates EquatorialCoordinates)
 Calculates a telescope direction vector from the supplied local hour angle and declination. More...
 
const TelescopeDirectionVector TelescopeDirectionVectorFromSphericalCoordinate (const double AzimuthAngle, AzimuthAngleDirection_t AzimuthAngleDirection, const double PolarAngle, PolarAngleDirection_t PolarAngleDirection)
 Calculates a telescope direction vector from the supplied spherical coordinate information. More...
 

Additional Inherited Members

- Public Types inherited from INDI::AlignmentSubsystem::InMemoryDatabase
typedef std::vector< AlignmentDatabaseEntryAlignmentDatabaseType
 
typedef void(* LoadDatabaseCallbackPointer_t) (void *)
 
- Public Types inherited from INDI::AlignmentSubsystem::MathPluginManagement
enum  MountType { EQUATORIAL , ALTAZ }
 Describes the basic type of the mount. More...
 
typedef enum INDI::AlignmentSubsystem::MathPluginManagement::MountType MountType_t
 
- Public Types inherited from INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions
enum  AzimuthAngleDirection { CLOCKWISE , ANTI_CLOCKWISE }
 
enum  PolarAngleDirection { FROM_POLAR_AXIS , FROM_AZIMUTHAL_PLANE }
 
typedef enum INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::AzimuthAngleDirection AzimuthAngleDirection_t
 
typedef enum INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions::PolarAngleDirection PolarAngleDirection_t
 

Detailed Description

This class encapsulates all the alignment subsystem classes that are useful to driver implementations. Drivers should inherit from this class.

Definition at line 29 of file AlignmentSubsystemForDrivers.h.

Constructor & Destructor Documentation

◆ AlignmentSubsystemForDrivers()

INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::AlignmentSubsystemForDrivers ( )

Default constructor.

Definition at line 15 of file AlignmentSubsystemForDrivers.cpp.

◆ ~AlignmentSubsystemForDrivers()

virtual INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::~AlignmentSubsystemForDrivers ( )
inlinevirtual

Virtual destructor.

Definition at line 37 of file AlignmentSubsystemForDrivers.h.

Member Function Documentation

◆ AddAlignmentEntryAltAz()

bool INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::AddAlignmentEntryAltAz ( double  actualRA,
double  actualDec,
double  mountAlt,
double  mountAz 
)

Adds an alignment point to the model database, usually called from Sync.

Parameters
[in]actualRAactual Right Ascension in decimal hours
[in]actualDecactual Declination in decimal degrees
[in]mountAltAltitude where the mount thinks it is in decimal degrees
[in]mountAzAzimuth where the mount thinks it is in decimal degrees
Returns
true if the alignment point was added to the database, otherwise false

This will return false if either the alignment point was already added, or if the location is not set. Call UpdateLocation to set the current location.

Definition at line 159 of file AlignmentSubsystemForDrivers.cpp.

◆ AddAlignmentEntryEquatorial()

bool INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::AddAlignmentEntryEquatorial ( double  actualRA,
double  actualDec,
double  mountRA,
double  mountDec 
)

Adds an alignment point to the model database, usually called from Sync.

Parameters
[in]actualRAactual Right Ascension in decimal hours
[in]actualDecactual Declination in decimal degrees
[in]mountRARight Ascension where the mount thinks it is in decimal hours
[in]mountDecDeclination where the mount thinks it is in decimal degrees
Returns
true if the alignment point was added to the database, otherwise false

This will return false if either the alignment point was already added, or if the location is not set. Call UpdateLocation to set the current location.

Definition at line 67 of file AlignmentSubsystemForDrivers.cpp.

◆ InitAlignmentProperties()

void INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::InitAlignmentProperties ( Telescope pTelescope)

Initilize alignment subsystem properties. It is recommended to call this function within initProperties() of your primary device.

Parameters
[in]pTelescopePointer to the child INDI::Telecope class

Definition at line 27 of file AlignmentSubsystemForDrivers.cpp.

◆ ProcessAlignmentBLOBProperties()

void INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::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 subsystem related properties.

Parameters
[in]pTelescopePointer to the child INDI::Telecope class
[in]namevector property name
[in]sizes
[in]blobsizes
[in]blobs
[in]formats
[in]names
[in]n

Definition at line 33 of file AlignmentSubsystemForDrivers.cpp.

◆ ProcessAlignmentNumberProperties()

void INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::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 alignment subsystem related properties.

Parameters
[in]pTelescopePointer to the child INDI::Telecope class
[in]namevector property name
[in]valuesvalue as passed by the client
[in]namesnames as passed by the client
[in]nnumber of values and names pair to process.

Definition at line 41 of file AlignmentSubsystemForDrivers.cpp.

◆ ProcessAlignmentSwitchProperties()

void INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::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 alignment subsystem related properties.

Parameters
[in]pTelescopePointer to the child INDI::Telecope class
[in]namevector property name
[in]statesstates as passed by the client
[in]namesnames as passed by the client
[in]nnumber of values and names pair to process.

Definition at line 47 of file AlignmentSubsystemForDrivers.cpp.

◆ ProcessAlignmentTextProperties()

void INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::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 subsystem related properties. This only text property at the moment is contained in the config file so this will normally only have work to do when the config file is loaded.

Parameters
[in]pTelescopePointer to the child INDI::Telecope class
[in]namevector property name
[in]textstexts as passed by the client
[in]namesnames as passed by the client
[in]nnumber of values and names pair to process.

Definition at line 54 of file AlignmentSubsystemForDrivers.cpp.

◆ SaveAlignmentConfigProperties()

void INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::SaveAlignmentConfigProperties ( FILE *  fp)

Call this function to save persistent alignment related properties. This function should be called from within the saveConfigItems function of your driver.

Parameters
[in]fpFile pointer passed into saveConfigItems

Definition at line 60 of file AlignmentSubsystemForDrivers.cpp.

◆ SkyToTelescopeAltAz()

bool INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::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.

Parameters
[in]actualRAactual Right Ascension in decimal hours
[in]actualDecactual Declination in decimal degrees
[out]mountAltAltitude to send to the mount
[out]mountAzAzimuth to send to the mount
Returns
true if we converted actualRA/actualDec to mountAlt/mountAz, otherwise false

This will return false if we have fewer than 2 alignment points added, or if the location is not set. Call UpdateLocation to set the current location.

Definition at line 192 of file AlignmentSubsystemForDrivers.cpp.

◆ SkyToTelescopeEquatorial()

bool INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::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.

Parameters
[in]actualRAactual Right Ascension in decimal hours
[in]actualDecactual Declination in decimal degrees
[out]mountRARight Ascension to send to the mount
[out]mountDecDeclination to send to the mount
Returns
true if we converted actualRA/actualDec to mountRa/mountDec, otherwise false

This will return false if we have fewer than 2 alignment points added, or if the location is not set. Call UpdateLocation to set the current location.

Definition at line 100 of file AlignmentSubsystemForDrivers.cpp.

◆ TelescopeAltAzToSky()

bool INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::TelescopeAltAzToSky ( double  mountAlt,
double  mountAz,
double &  actualRA,
double &  actualDec 
)

Converts a mount location to actual sky coordinates, usually called in ReadScopeStatus.

Parameters
[in]mountAltAltitude where the mount thinks it is in decimal degrees
[in]mountAzAzimuth where the mount thinks it is in decimal degrees
[out]actualRAactual Right Ascension in decimal hours
[out]actualDecactual Declination in decimal degrees
Returns
true if we converted mountRa/mountDec to actualRA/actualDec, otherwise false

This will return false if we have fewer than 2 alignment points added, or if the location is not set. Call UpdateLocation to set the current location.

Definition at line 217 of file AlignmentSubsystemForDrivers.cpp.

◆ TelescopeEquatorialToSky()

bool INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::TelescopeEquatorialToSky ( double  mountRA,
double  mountDec,
double &  actualRA,
double &  actualDec 
)

Converts a mount location to actual sky coordinates, usually called in ReadScopeStatus.

Parameters
[in]mountRARight Ascension where the mount thinks it is in decimal hours
[in]mountDecDeclination where the mount thinks it is in decimal degrees
[out]actualRAactual Right Ascension in decimal hours
[out]actualDecactual Declination in decimal degrees
Returns
true if we converted mountRa/mountDec to actualRA/actualDec, otherwise false

This will return false if we have fewer than 2 alignment points added, or if the location is not set. Call UpdateLocation to set the current location.

Definition at line 131 of file AlignmentSubsystemForDrivers.cpp.


The documentation for this class was generated from the following files: