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

This class provides the client API to the driver side alignment database. It communicates with the driver via the INDI properties interface. More...

#include <ClientAPIForAlignmentDatabase.h>

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

Public Member Functions

 ClientAPIForAlignmentDatabase ()
 Default constructor. More...
 
virtual ~ClientAPIForAlignmentDatabase ()
 Virtual destructor. More...
 
bool AppendSyncPoint (const AlignmentDatabaseEntry &CurrentValues)
 Append a sync point to the database. More...
 
bool ClearSyncPoints ()
 Delete all sync points from the database. More...
 
bool DeleteSyncPoint (unsigned int Offset)
 Delete a sync point from the database. More...
 
bool EditSyncPoint (unsigned int Offset, const AlignmentDatabaseEntry &CurrentValues)
 Edit a sync point in the database. More...
 
int GetDatabaseSize ()
 Return the number of entries in the database. More...
 
void Initialise (INDI::BaseClient *BaseClient)
 Initialise the API. More...
 
bool InsertSyncPoint (unsigned int Offset, const AlignmentDatabaseEntry &CurrentValues)
 Insert a sync point in the database. More...
 
bool LoadDatabase ()
 Load the database from persistent storage. More...
 
void ProcessNewBLOB (IBLOB *BLOBPointer)
 Process new BLOB message from driver. More...
 
void ProcessNewDevice (INDI::BaseDevice *DevicePointer)
 Process new device message from driver. More...
 
void ProcessNewNumber (INumberVectorProperty *NumberVectorProperty)
 Process new number message from driver. More...
 
void ProcessNewProperty (INDI::Property *PropertyPointer)
 Process new property message from driver. More...
 
void ProcessNewSwitch (ISwitchVectorProperty *SwitchVectorProperty)
 Process new switch message from driver. More...
 
bool ReadIncrementSyncPoint (AlignmentDatabaseEntry &CurrentValues)
 Increment the current offset then read a sync point from the database. More...
 
bool ReadSyncPoint (unsigned int Offset, AlignmentDatabaseEntry &CurrentValues)
 Read a sync point from the database. More...
 
bool SaveDatabase ()
 Save the database to persistent storage. More...
 

Private Member Functions

bool SendEntryData (const AlignmentDatabaseEntry &CurrentValues)
 
bool SetDriverBusy ()
 
bool SignalDriverCompletion ()
 
bool WaitForDriverCompletion ()
 

Private Attributes

INDI::BaseClientBaseClient { nullptr }
 
pthread_cond_t DriverActionCompleteCondition
 
pthread_mutex_t DriverActionCompleteMutex
 
bool DriverActionComplete { false }
 
INDI::BaseDeviceDevice { nullptr }
 
INDI::PropertyMandatoryNumbers { nullptr }
 
INDI::PropertyOptionalBinaryBlob { nullptr }
 
INDI::PropertyPointsetSize { nullptr }
 
INDI::PropertyCurrentEntry { nullptr }
 
INDI::PropertyAction { nullptr }
 
INDI::PropertyCommit { nullptr }
 

Detailed Description

This class provides the client API to the driver side alignment database. It communicates with the driver via the INDI properties interface.

Constructor & Destructor Documentation

◆ ClientAPIForAlignmentDatabase()

INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::ClientAPIForAlignmentDatabase ( )

Default constructor.

◆ ~ClientAPIForAlignmentDatabase()

INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::~ClientAPIForAlignmentDatabase ( )
virtual

Virtual destructor.

Member Function Documentation

◆ AppendSyncPoint()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::AppendSyncPoint ( const AlignmentDatabaseEntry CurrentValues)

Append a sync point to the database.

Parameters
[in]CurrentValuesThe entry to append.
Returns
True if successful

◆ ClearSyncPoints()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::ClearSyncPoints ( )

Delete all sync points from the database.

Returns
True if successful

◆ DeleteSyncPoint()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::DeleteSyncPoint ( unsigned int  Offset)

Delete a sync point from the database.

Parameters
[in]OffsetPointer to the entry to delete
Returns
True if successful

◆ EditSyncPoint()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::EditSyncPoint ( unsigned int  Offset,
const AlignmentDatabaseEntry CurrentValues 
)

Edit a sync point in the database.

Parameters
[in]OffsetPointer to where to make the edit.
[in]CurrentValuesThe entry to edit.
Returns
True if successful

◆ GetDatabaseSize()

int INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::GetDatabaseSize ( )

Return the number of entries in the database.

Returns
The number of entries in the database

◆ Initialise()

void INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::Initialise ( INDI::BaseClient BaseClient)

Initialise the API.

Parameters
[in]BaseClientA pointer to the INDI::BaseClient class

◆ InsertSyncPoint()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::InsertSyncPoint ( unsigned int  Offset,
const AlignmentDatabaseEntry CurrentValues 
)

Insert a sync point in the database.

Parameters
[in]OffsetPointer to where to make then insertion.
[in]CurrentValuesThe entry to insert.
Returns
True if successful

◆ LoadDatabase()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::LoadDatabase ( )

Load the database from persistent storage.

Returns
True if successful

◆ ProcessNewBLOB()

void INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::ProcessNewBLOB ( IBLOB BLOBPointer)

Process new BLOB message from driver.

This routine should be called from within the newBLOB handler in the client. This routine is not normally called directly but is called by the ProcessNewBLOB function in INDI::Alignment::AlignmentSubsystemForClients which filters out calls from unwanted devices. TODO maybe hide this function.

Parameters
[in]BLOBPointerA pointer to the INDI::IBLOB.

◆ ProcessNewDevice()

void INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::ProcessNewDevice ( INDI::BaseDevice DevicePointer)

Process new device message from driver.

This routine should be called from within the newDevice handler in the client. This routine is not normally called directly but is called by the ProcessNewDevice function in INDI::Alignment::AlignmentSubsystemForClients which filters out calls from unwanted devices. TODO maybe hide this function.

Parameters
[in]DevicePointerA pointer to the INDI::BaseDevice object.

◆ ProcessNewNumber()

void INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::ProcessNewNumber ( INumberVectorProperty NumberVectorProperty)

Process new number message from driver.

This routine should be called from within the newNumber handler in the client. This routine is not normally called directly but it is called by the ProcessNewNumber function in INDI::Alignment::AlignmentSubsystemForClients which filters out calls from unwanted devices. TODO maybe hide this function.

Parameters
[in]NumberVectorPropertyA pointer to the INDI::INumberVectorProperty.

◆ ProcessNewProperty()

void INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::ProcessNewProperty ( INDI::Property PropertyPointer)

Process new property message from driver.

This routine should be called from within the newProperty handler in the client. This routine is not normally called directly but it is called by the ProcessNewProperty function in INDI::Alignment::AlignmentSubsystemForClients which filters out calls from unwanted devices. TODO maybe hide this function.

Parameters
[in]PropertyPointerA pointer to the INDI::Property object.

◆ ProcessNewSwitch()

void INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::ProcessNewSwitch ( ISwitchVectorProperty SwitchVectorProperty)

Process new switch message from driver.

This routine should be called from within the newSwitch handler in the client. This routine is not normally called directly but it is called by the ProcessNewSwitch function in INDI::Alignment::AlignmentSubsystemForClients which filters out calls from unwanted devices. TODO maybe hide this function.

Parameters
[in]SwitchVectorPropertyA pointer to the INDI::ISwitchVectorProperty.

◆ ReadIncrementSyncPoint()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::ReadIncrementSyncPoint ( AlignmentDatabaseEntry CurrentValues)

Increment the current offset then read a sync point from the database.

Parameters
[out]CurrentValuesThe entry read.
Returns
True if successful

◆ ReadSyncPoint()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::ReadSyncPoint ( unsigned int  Offset,
AlignmentDatabaseEntry CurrentValues 
)

Read a sync point from the database.

Parameters
[in]OffsetPointer to where to read from.
[out]CurrentValuesThe entry read.
Returns
True if successful

◆ SaveDatabase()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::SaveDatabase ( )

Save the database to persistent storage.

Returns
True if successful

◆ SendEntryData()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::SendEntryData ( const AlignmentDatabaseEntry CurrentValues)
private

◆ SetDriverBusy()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::SetDriverBusy ( )
private

◆ SignalDriverCompletion()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::SignalDriverCompletion ( )
private

◆ WaitForDriverCompletion()

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::WaitForDriverCompletion ( )
private

Member Data Documentation

◆ Action

INDI::Property* INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::Action { nullptr }
private

◆ BaseClient

INDI::BaseClient* INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::BaseClient { nullptr }
private

◆ Commit

INDI::Property* INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::Commit { nullptr }
private

◆ CurrentEntry

INDI::Property* INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::CurrentEntry { nullptr }
private

◆ Device

INDI::BaseDevice* INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::Device { nullptr }
private

◆ DriverActionComplete

bool INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::DriverActionComplete { false }
private

◆ DriverActionCompleteCondition

pthread_cond_t INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::DriverActionCompleteCondition
private

◆ DriverActionCompleteMutex

pthread_mutex_t INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::DriverActionCompleteMutex
private

◆ MandatoryNumbers

INDI::Property* INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::MandatoryNumbers { nullptr }
private

◆ OptionalBinaryBlob

INDI::Property* INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::OptionalBinaryBlob { nullptr }
private

◆ PointsetSize

INDI::Property* INDI::AlignmentSubsystem::ClientAPIForAlignmentDatabase::PointsetSize { nullptr }
private

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