TwiceAsNice  2019-02-18
Public Member Functions | Static Private 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:
Inheritance graph
Collaboration diagram for INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers:
Collaboration graph

Public Member Functions

 AlignmentSubsystemForDrivers ()
 Default constructor. More...
 
virtual ~AlignmentSubsystemForDrivers ()
 Virtual destructor. More...
 
void InitAlignmentProperties (Telescope *pTelescope)
 Initilize alignment subsystem properties. 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. More...
 
void ProcessAlignmentNumberProperties (Telescope *pTelescope, const char *name, double values[], char *names[], int n)
 Call this function from within the ISNewNumber processing path. More...
 
void ProcessAlignmentSwitchProperties (Telescope *pTelescope, const char *name, ISState *states, char *names[], int n)
 Call this function from within the ISNewSwitch processing path. More...
 
void ProcessAlignmentTextProperties (Telescope *pTelescope, const char *name, char *texts[], char *names[], int n)
 Call this function from within the ISNewText processing path. More...
 
void SaveAlignmentConfigProperties (FILE *fp)
 Call this function to save persistent alignment related properties. More...
 
- Public Member Functions inherited from INDI::AlignmentSubsystem::MapPropertiesToInMemoryDatabase
virtual ~MapPropertiesToInMemoryDatabase ()
 Virtual destructor. More...
 
void InitProperties (Telescope *pTelescope)
 Initialize alignment database properties. 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. More...
 
void ProcessNumberProperties (Telescope *pTelescope, const char *name, double values[], char *names[], int n)
 Call this function from within the ISNewNumber processing path. More...
 
void ProcessSwitchProperties (Telescope *pTelescope, const char *name, ISState *states, char *names[], int n)
 Call this function from within the ISNewSwitch processing path. 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...
 
AlignmentDatabaseTypeGetAlignmentDatabase ()
 Get a reference to the in memory database. More...
 
bool GetDatabaseReferencePosition (ln_lnlat_posn &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. More...
 
void ProcessSwitchProperties (Telescope *pTelescope, const char *name, ISState *states, char *names[], int n)
 Call this function from within the ISNewSwitch processing path. More...
 
void ProcessTextProperties (Telescope *pTelescope, const char *name, char *texts[], char *names[], int n)
 Call this function from within the ISNewText processing path. More...
 
void SaveConfigProperties (FILE *fp)
 Call this function to save persistent math plugin properties. More...
 
void SetApproximateMountAlignmentFromMountType (MountType_t Type)
 Call this function to set the ApproximateMountAlignment property of the current Math Plugin. 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. 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)
 Get the alignment corrected telescope pointing direction for the supplied celestial coordinates. More...
 
bool TransformTelescopeToCelestial (const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination)
 Get the true celestial coordinates for the supplied telescope pointing direction. More...
 
- Public Member Functions inherited from INDI::AlignmentSubsystem::TelescopeDirectionVectorSupportFunctions
virtual ~TelescopeDirectionVectorSupportFunctions ()
 Virtual destructor. More...
 
void AltitudeAzimuthFromTelescopeDirectionVector (const TelescopeDirectionVector TelescopeDirectionVector, ln_hrz_posn &HorizontalCoordinates)
 Calculates an altitude and azimuth from the supplied normalised direction vector and declination. More...
 
void AltitudeAzimuthFromTelescopeDirectionVector (const TelescopeDirectionVector TelescopeDirectionVector, lnh_hrz_posn &HorizontalCoordinates)
 Calculates an altitude and azimuth from the supplied normalised direction vector and declination. More...
 
void EquatorialCoordinatesFromTelescopeDirectionVector (const TelescopeDirectionVector TelescopeDirectionVector, struct ln_equ_posn &EquatorialCoordinates)
 Calculates equatorial coordinates from the supplied telescope direction vector and declination. More...
 
void EquatorialCoordinatesFromTelescopeDirectionVector (const TelescopeDirectionVector TelescopeDirectionVector, struct lnh_equ_posn &EquatorialCoordinates)
 Calculates equatorial coordinates from the supplied telescope direction vector and declination. More...
 
void LocalHourAngleDeclinationFromTelescopeDirectionVector (const TelescopeDirectionVector TelescopeDirectionVector, struct ln_equ_posn &EquatorialCoordinates)
 Calculates a local hour angle and declination from the supplied telescope direction vector and declination. More...
 
void LocalHourAngleDeclinationFromTelescopeDirectionVector (const TelescopeDirectionVector TelescopeDirectionVector, struct lnh_equ_posn &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 (ln_hrz_posn HorizontalCoordinates)
 Calculates a normalised direction vector from the supplied altitude and azimuth. More...
 
const TelescopeDirectionVector TelescopeDirectionVectorFromAltitudeAzimuth (lnh_hrz_posn HorizontalCoordinates)
 Calculates a normalised direction vector from the supplied altitude and azimuth. More...
 
const TelescopeDirectionVector TelescopeDirectionVectorFromEquatorialCoordinates (struct ln_equ_posn EquatorialCoordinates)
 Calculates a telescope direction vector from the supplied equatorial coordinates. More...
 
const TelescopeDirectionVector TelescopeDirectionVectorFromEquatorialCoordinates (struct lnh_equ_posn EquatorialCoordinates)
 Calculates a telescope direction vector from the supplied equatorial coordinates. More...
 
const TelescopeDirectionVector TelescopeDirectionVectorFromLocalHourAngleDeclination (struct ln_equ_posn 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...
 

Static Private Member Functions

static void MyDatabaseLoadCallback (void *ThisPointer)
 This static function is registered as a load database callback with the in memory database module. 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.

Constructor & Destructor Documentation

◆ AlignmentSubsystemForDrivers()

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

Default constructor.

◆ ~AlignmentSubsystemForDrivers()

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

Virtual destructor.

Member Function Documentation

◆ 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

◆ MyDatabaseLoadCallback()

void INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers::MyDatabaseLoadCallback ( void *  ThisPointer)
staticprivate

This static function is registered as a load database callback with the in memory database module.

This registration is performed in the constructor of of this class. The callback is called whenever the database is is loaded or reloaded, by default it calls the Initialise function of the MathPluginManagment module.

Parameters
[in]ThisPointerPointer to the instance of this class which registered the callbck

◆ 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

◆ 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.

◆ 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.

◆ 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.

◆ 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

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