TwiceAsNice  2019-02-18
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
INDI::AlignmentSubsystem::MathPluginManagement Class Reference

The following INDI properties are used to manage math plugins. More...

#include <MathPluginManagement.h>

Inheritance diagram for INDI::AlignmentSubsystem::MathPluginManagement:
Inheritance graph
Collaboration diagram for INDI::AlignmentSubsystem::MathPluginManagement:
Collaboration graph

Public Types

enum  MountType { EQUATORIAL, ALTAZ }
 Describes the basic type of the mount. More...
 
typedef enum INDI::AlignmentSubsystem::MathPluginManagement::MountType MountType_t
 

Public Member Functions

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

Private Member Functions

void EnumeratePlugins ()
 
- Private Member Functions inherited from INDI::AlignmentSubsystem::MathPlugin
 MathPlugin (MountAlignment_t ApproximateAlignment=ZENITH)
 Default constructor. More...
 
virtual ~MathPlugin ()
 Virtual destructor. More...
 

Private Attributes

std::vector< std::string > MathPluginFiles
 
std::vector< std::string > MathPluginDisplayNames
 
std::unique_ptr< ISwitchAlignmentSubsystemMathPlugins
 
ISwitchVectorProperty AlignmentSubsystemMathPluginsV
 
ISwitch AlignmentSubsystemMathPluginInitialise
 
ISwitchVectorProperty AlignmentSubsystemMathPluginInitialiseV
 
ISwitch AlignmentSubsystemActive
 
ISwitchVectorProperty AlignmentSubsystemActiveV
 
InMemoryDatabaseCurrentInMemoryDatabase
 
IText AlignmentSubsystemCurrentMathPlugin
 
ITextVectorProperty AlignmentSubsystemCurrentMathPluginV
 
MountAlignment_t(MathPlugin::* pGetApproximateMountAlignment )()
 
bool(MathPlugin::* pInitialise )(InMemoryDatabase *pInMemoryDatabase)
 
void(MathPlugin::* pSetApproximateMountAlignment )(MountAlignment_t ApproximateAlignment)
 
bool(MathPlugin::* pTransformCelestialToTelescope )(const double RightAscension, const double Declination, double JulianOffset, TelescopeDirectionVector &TelescopeDirectionVector)
 
bool(MathPlugin::* pTransformTelescopeToCelestial )(const TelescopeDirectionVector &TelescopeDirectionVector, double &RightAscension, double &Declination)
 
MathPluginpLoadedMathPlugin
 
void * LoadedMathPluginHandle
 
BuiltInMathPlugin BuiltInPlugin
 
- Private Attributes inherited from INDI::AlignmentSubsystem::MathPlugin
MountAlignment_t ApproximateMountAlignment
 Describe the approximate alignment of the mount. More...
 
InMemoryDatabasepInMemoryDatabase
 

Detailed Description

The following INDI properties are used to manage math plugins.

This class also provides function links to the currently selected math plugin

Member Typedef Documentation

◆ MountType_t

Member Enumeration Documentation

◆ MountType

Describes the basic type of the mount.

Enumerator
EQUATORIAL 
ALTAZ 

Constructor & Destructor Documentation

◆ MathPluginManagement()

INDI::AlignmentSubsystem::MathPluginManagement::MathPluginManagement ( )

Default constructor.

◆ ~MathPluginManagement()

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

Virtual destructor.

Member Function Documentation

◆ EnumeratePlugins()

void INDI::AlignmentSubsystem::MathPluginManagement::EnumeratePlugins ( )
private

◆ GetApproximateMountAlignment()

MountAlignment_t INDI::AlignmentSubsystem::MathPluginManagement::GetApproximateMountAlignment ( )
virtual

Get the approximate alognment of the mount.

Returns
the approximate alignment

Reimplemented from INDI::AlignmentSubsystem::MathPlugin.

◆ Initialise()

bool INDI::AlignmentSubsystem::MathPluginManagement::Initialise ( InMemoryDatabase pInMemoryDatabase)
virtual

Initialise or re-initialise the math plugin.

Re-reading the in memory database as necessary.

Returns
True if successful

Reimplemented from INDI::AlignmentSubsystem::MathPlugin.

◆ InitProperties()

void INDI::AlignmentSubsystem::MathPluginManagement::InitProperties ( Telescope pTelescope)

Initialize alignment math plugin properties.

It is recommended to call this function within initProperties() of your primary device

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

◆ IsAlignmentSubsystemActive()

bool INDI::AlignmentSubsystem::MathPluginManagement::IsAlignmentSubsystemActive ( ) const
inline

Return status of alignment subsystem.

Returns
True if active

◆ ProcessSwitchProperties()

void INDI::AlignmentSubsystem::MathPluginManagement::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.

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.

◆ ProcessTextProperties()

void INDI::AlignmentSubsystem::MathPluginManagement::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.

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.

◆ SaveConfigProperties()

void INDI::AlignmentSubsystem::MathPluginManagement::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.

Parameters
[in]fpFile pointer passed into saveConfigItems

◆ SetAlignmentSubsystemActive()

void INDI::AlignmentSubsystem::MathPluginManagement::SetAlignmentSubsystemActive ( bool  enable)

SetAlignmentSubsystemActive Enable or Disable alignment subsystem.

Parameters
enableTrue to activate Alignment Subsystem. False to deactivate Alignment subsystem.

◆ SetApproximateMountAlignment()

void INDI::AlignmentSubsystem::MathPluginManagement::SetApproximateMountAlignment ( MountAlignment_t  ApproximateAlignment)
virtual

Set the approximate alognment of the mount.

Parameters
[in]ApproximateAlignment- the approximate alignment of the mount

Reimplemented from INDI::AlignmentSubsystem::MathPlugin.

◆ SetApproximateMountAlignmentFromMountType()

void INDI::AlignmentSubsystem::MathPluginManagement::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.

Parameters
[in]Typethe mount type either EQUATORIAL or ALTAZ

◆ SetCurrentInMemoryDatabase()

void INDI::AlignmentSubsystem::MathPluginManagement::SetCurrentInMemoryDatabase ( InMemoryDatabase pDatabase)
inline

Set the current in memory database.

Parameters
[in]pDatabaseA pointer to the current in memory database

◆ TransformCelestialToTelescope()

bool INDI::AlignmentSubsystem::MathPluginManagement::TransformCelestialToTelescope ( const double  RightAscension,
const double  Declination,
double  JulianOffset,
TelescopeDirectionVector ApparentTelescopeDirectionVector 
)
virtual

Get the alignment corrected telescope pointing direction for the supplied celestial coordinates.

Parameters
[in]RightAscensionRight Ascension (Decimal Hours).
[in]DeclinationDeclination (Decimal Degrees).
[in]JulianOffsetto be applied to the current julian date.
[out]ApparentTelescopeDirectionVectorParameter to receive the corrected telescope direction
Returns
True if successful

Implements INDI::AlignmentSubsystem::MathPlugin.

◆ TransformTelescopeToCelestial()

bool INDI::AlignmentSubsystem::MathPluginManagement::TransformTelescopeToCelestial ( const TelescopeDirectionVector ApparentTelescopeDirectionVector,
double &  RightAscension,
double &  Declination 
)
virtual

Get the true celestial coordinates for the supplied telescope pointing direction.

Parameters
[in]ApparentTelescopeDirectionVectorthe telescope direction
[out]RightAscensionParameter to receive the Right Ascension (Decimal Hours).
[out]DeclinationParameter to receive the Declination (Decimal Degrees).
Returns
True if successful

Implements INDI::AlignmentSubsystem::MathPlugin.

Member Data Documentation

◆ AlignmentSubsystemActive

ISwitch INDI::AlignmentSubsystem::MathPluginManagement::AlignmentSubsystemActive
private

◆ AlignmentSubsystemActiveV

ISwitchVectorProperty INDI::AlignmentSubsystem::MathPluginManagement::AlignmentSubsystemActiveV
private

◆ AlignmentSubsystemCurrentMathPlugin

IText INDI::AlignmentSubsystem::MathPluginManagement::AlignmentSubsystemCurrentMathPlugin
private

◆ AlignmentSubsystemCurrentMathPluginV

ITextVectorProperty INDI::AlignmentSubsystem::MathPluginManagement::AlignmentSubsystemCurrentMathPluginV
private

◆ AlignmentSubsystemMathPluginInitialise

ISwitch INDI::AlignmentSubsystem::MathPluginManagement::AlignmentSubsystemMathPluginInitialise
private

◆ AlignmentSubsystemMathPluginInitialiseV

ISwitchVectorProperty INDI::AlignmentSubsystem::MathPluginManagement::AlignmentSubsystemMathPluginInitialiseV
private

◆ AlignmentSubsystemMathPlugins

std::unique_ptr<ISwitch> INDI::AlignmentSubsystem::MathPluginManagement::AlignmentSubsystemMathPlugins
private

◆ AlignmentSubsystemMathPluginsV

ISwitchVectorProperty INDI::AlignmentSubsystem::MathPluginManagement::AlignmentSubsystemMathPluginsV
private

◆ BuiltInPlugin

BuiltInMathPlugin INDI::AlignmentSubsystem::MathPluginManagement::BuiltInPlugin
private

◆ CurrentInMemoryDatabase

InMemoryDatabase* INDI::AlignmentSubsystem::MathPluginManagement::CurrentInMemoryDatabase
private

◆ LoadedMathPluginHandle

void* INDI::AlignmentSubsystem::MathPluginManagement::LoadedMathPluginHandle
private

◆ MathPluginDisplayNames

std::vector<std::string> INDI::AlignmentSubsystem::MathPluginManagement::MathPluginDisplayNames
private

◆ MathPluginFiles

std::vector<std::string> INDI::AlignmentSubsystem::MathPluginManagement::MathPluginFiles
private

◆ pGetApproximateMountAlignment

MountAlignment_t(MathPlugin::* INDI::AlignmentSubsystem::MathPluginManagement::pGetApproximateMountAlignment) ()
private

◆ pInitialise

bool(MathPlugin::* INDI::AlignmentSubsystem::MathPluginManagement::pInitialise) (InMemoryDatabase *pInMemoryDatabase)
private

◆ pLoadedMathPlugin

MathPlugin* INDI::AlignmentSubsystem::MathPluginManagement::pLoadedMathPlugin
private

◆ pSetApproximateMountAlignment

void(MathPlugin::* INDI::AlignmentSubsystem::MathPluginManagement::pSetApproximateMountAlignment) (MountAlignment_t ApproximateAlignment)
private

◆ pTransformCelestialToTelescope

bool(MathPlugin::* INDI::AlignmentSubsystem::MathPluginManagement::pTransformCelestialToTelescope) (const double RightAscension, const double Declination, double JulianOffset, TelescopeDirectionVector &TelescopeDirectionVector)
private

◆ pTransformTelescopeToCelestial

bool(MathPlugin::* INDI::AlignmentSubsystem::MathPluginManagement::pTransformTelescopeToCelestial) (const TelescopeDirectionVector &TelescopeDirectionVector, double &RightAscension, double &Declination)
private

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