KSUserDB

Search for usage in LXR

KSUserDB Class Reference

#include <ksuserdb.h>

Public Member Functions

bool AddCustomDriver (const QVariantMap &oneDriver)
 
void AddDarkFrame (const QVariantMap &oneFrame)
 
void AddDSLRInfo (const QMap< QString, QVariant > &oneInfo)
 
void AddEffectiveFOV (const QVariantMap &oneFOV)
 
void AddEyepiece (const QString &vendor, const QString &model, const double &focalLength, const double &fov, const QString &fovunit)
 
void AddEyepiece (const QString &vendor, const QString &model, const double &focalLength, const double &fov, const QString &fovunit, const QString &id)
 
void AddFilter (const QString &vendor, const QString &model, const QString &type, const QString &color, int offset, double exposure, bool useAutoFocus, const QString &lockedFilter, int absFocusPos)
 
void AddFilter (const QString &vendor, const QString &model, const QString &type, const QString &color, int offset, double exposure, bool useAutoFocus, const QString &lockedFilter, int absFocusPos, const QString &id)
 
void AddFlag (const QString &ra, const QString &dec, const QString &epoch, const QString &image_name, const QString &label, const QString &labelColor)
 
void AddHIPSSource (const QMap< QString, QString > &oneSource)
 
void AddHorizon (ArtificialHorizonEntity *horizon)
 
void AddLens (const QString &vendor, const QString &model, const double &factor)
 
void AddLens (const QString &vendor, const QString &model, const double &factor, const QString &id)
 
void AddObserver (const QString &name, const QString &surname, const QString &contact)
 
int AddProfile (const QString &name)
 
void AddScope (const QString &model, const QString &vendor, const QString &driver, const QString &type, const double &focalLength, const double &aperture)
 
void AddScope (const QString &model, const QString &vendor, const QString &driver, const QString &type, const double &focalLength, const double &aperture, const QString &id)
 
bool DeleteAllDSLRInfo ()
 
void DeleteAllEquipment (const QString &type)
 
void DeleteAllFlags ()
 
void DeleteAllHorizons ()
 
bool DeleteCustomDriver (const QString &id)
 
void DeleteDarkFrame (const QString &filename)
 
bool DeleteDSLRInfo (const QString &model)
 
bool DeleteEffectiveFOV (const QString &id)
 
void DeleteEquipment (const QString &type, const int &id)
 
bool DeleteHIPSSource (const QString &ID)
 
bool DeleteObserver (const QString &id)
 
bool DeleteProfile (ProfileInfo *pi)
 
bool FindObserver (const QString &name, const QString &surname)
 
void GetAllCustomDrivers (QList< QVariantMap > &CustomDrivers)
 
void GetAllDarkFrames (QList< QVariantMap > &darkFrames)
 
void GetAllDSLRInfos (QList< QMap< QString, QVariant >> &DSLRInfos)
 
void GetAllEffectiveFOVs (QList< QVariantMap > &effectiveFOVs)
 
void GetAllEyepieces (QList< OAL::Eyepiece * > &m_eyepieceList)
 
void GetAllFilters (QList< OAL::Filter * > &m_filterList)
 
QList< QStringListGetAllFlags ()
 
void GetAllHIPSSources (QList< QMap< QString, QString >> &HIPSSources)
 
QList< ArtificialHorizonEntity * > GetAllHorizons ()
 
void GetAllLenses (QList< OAL::Lens * > &m_lensList)
 
void GetAllObservers (QList< OAL::Observer * > &observer_list)
 
void GetAllProfiles (QList< std::shared_ptr< ProfileInfo >> &profiles)
 
void GetAllScopes (QList< OAL::Scope * > &m_scopeList)
 
QSqlDatabase GetDatabase ()
 
bool Initialize ()
 
void SaveProfile (ProfileInfo *pi)
 
void UpdateDarkFrame (const QVariantMap &oneFrame)
 

Detailed Description

Single class to delegate all User database I/O.

usage: Call QSqlDatabase::removeDatabase("userdb"); after the object of this class is deallocated

Author
Rishab Arora
Jasem Mutlaq
Version
1.2

Definition at line 37 of file ksuserdb.h.

Member Function Documentation

◆ AddDarkFrame()

void KSUserDB::AddDarkFrame ( const QVariantMap &  oneFrame)

KSUserDB::AddDarkFrame Saves a new dark frame data to the database.

Parameters
oneFrameMap that contains 1 to 1 correspondence with the database table, except for primary key and timestamp.

Definition at line 571 of file ksuserdb.cpp.

◆ AddEyepiece() [1/2]

void KSUserDB::AddEyepiece ( const QString vendor,
const QString model,
const double &  focalLength,
const double &  fov,
const QString fovunit 
)

Add new eyepiece to database.

Returns
void

Definition at line 1107 of file ksuserdb.cpp.

◆ AddEyepiece() [2/2]

void KSUserDB::AddEyepiece ( const QString vendor,
const QString model,
const double &  focalLength,
const double &  fov,
const QString fovunit,
const QString id 
)

Replace eyepiece at position (ID) with new content.

Returns
void

Definition at line 1127 of file ksuserdb.cpp.

◆ AddFilter() [1/2]

void KSUserDB::AddFilter ( const QString vendor,
const QString model,
const QString type,
const QString color,
int  offset,
double  exposure,
bool  useAutoFocus,
const QString lockedFilter,
int  absFocusPos 
)

Add a new filter to the database.

Returns
void

Definition at line 1245 of file ksuserdb.cpp.

◆ AddFilter() [2/2]

void KSUserDB::AddFilter ( const QString vendor,
const QString model,
const QString type,
const QString color,
int  offset,
double  exposure,
bool  useAutoFocus,
const QString lockedFilter,
int  absFocusPos,
const QString id 
)

Replace a filter at given ID with new content.

Returns
void

Definition at line 1288 of file ksuserdb.cpp.

◆ AddFlag()

void KSUserDB::AddFlag ( const QString ra,
const QString dec,
const QString epoch,
const QString image_name,
const QString label,
const QString labelColor 
)

Add a new Flag with given parameters.

Parameters
raRight Ascension
decDeclination
epochEpoch
image_nameName of the image used
labelContent of display label on screen
labelColorColor of the label (name or hex code) eg #00FF00
Returns
void

Definition at line 939 of file ksuserdb.cpp.

◆ AddLens() [1/2]

void KSUserDB::AddLens ( const QString vendor,
const QString model,
const double &  factor 
)

Add a new lens to the database.

Returns
void

Definition at line 1181 of file ksuserdb.cpp.

◆ AddLens() [2/2]

void KSUserDB::AddLens ( const QString vendor,
const QString model,
const double &  factor,
const QString id 
)

Replace a lens at given ID with new content.

Returns
void

Definition at line 1198 of file ksuserdb.cpp.

◆ AddObserver()

void KSUserDB::AddObserver ( const QString name,
const QString surname,
const QString contact 
)

Adds a new observer into the database.

Definition at line 472 of file ksuserdb.cpp.

◆ AddScope() [1/2]

void KSUserDB::AddScope ( const QString model,
const QString vendor,
const QString driver,
const QString type,
const double &  focalLength,
const double &  aperture 
)

Appends the scope with given details in the database.

Returns
void

Definition at line 1030 of file ksuserdb.cpp.

◆ AddScope() [2/2]

void KSUserDB::AddScope ( const QString model,
const QString vendor,
const QString driver,
const QString type,
const double &  focalLength,
const double &  aperture,
const QString id 
)

Replaces the scope with given ID with provided content.

Returns
void

Definition at line 1051 of file ksuserdb.cpp.

◆ DeleteAllEquipment()

void KSUserDB::DeleteAllEquipment ( const QString type)

Erases the whole equipment table of given type.

Parameters
typeEquipment type (same as table name)
Returns
void

Definition at line 1012 of file ksuserdb.cpp.

◆ DeleteAllFlags()

void KSUserDB::DeleteAllFlags ( )

Erases all the flags from the database.

Returns
void

Definition at line 924 of file ksuserdb.cpp.

◆ DeleteDarkFrame()

void KSUserDB::DeleteDarkFrame ( const QString filename)

KSUserDB::DeleteDarkFrame Delete from database a dark frame record that matches the filename field.

Parameters
filenamefilename of dark frame to delete from database.

Definition at line 616 of file ksuserdb.cpp.

◆ DeleteEquipment()

void KSUserDB::DeleteEquipment ( const QString type,
const int &  id 
)

Erase the equipment with given type and unique id Valid equipment types: "telescope","lens","filter".

Parameters
typeEquipment type (same as table name)
idUnique id (same as row number)
Returns
void

Definition at line 997 of file ksuserdb.cpp.

◆ DeleteObserver()

bool KSUserDB::DeleteObserver ( const QString id)

Removes the user with unique id as given by FindObserver Returns false if the user is not found.

Returns
bool

Definition at line 518 of file ksuserdb.cpp.

◆ FindObserver()

bool KSUserDB::FindObserver ( const QString name,
const QString surname 
)

Returns the unique id of the user with given name & surname.

Returns
true if found, false otherwise

Definition at line 502 of file ksuserdb.cpp.

◆ GetAllEyepieces()

void KSUserDB::GetAllEyepieces ( QList< OAL::Eyepiece * > &  m_eyepieceList)

Populate the reference passed with all eyepieces.

Parameters
m_eyepieceListReference to list of eyepieces
Returns
void

Definition at line 1151 of file ksuserdb.cpp.

◆ GetAllFilters()

void KSUserDB::GetAllFilters ( QList< OAL::Filter * > &  m_filterList)

Populate the reference passed with all filters.

Parameters
m_filterListReference to list of filters
Returns
void

Definition at line 1317 of file ksuserdb.cpp.

◆ GetAllFlags()

QList< QStringList > KSUserDB::GetAllFlags ( )

Returns a QList populated with all stored flags Order: const QString &ra, const QString &dec, const QString &epoch, const QString &imageName, const QString &label, const QString &labelColor.

Returns
QList< QStringList >

Definition at line 960 of file ksuserdb.cpp.

◆ GetAllLenses()

void KSUserDB::GetAllLenses ( QList< OAL::Lens * > &  m_lensList)

Populate the reference passed with all lenses.

Parameters
m_lensListReference to list of lenses
Returns
void

Definition at line 1218 of file ksuserdb.cpp.

◆ GetAllObservers()

void KSUserDB::GetAllObservers ( QList< OAL::Observer * > &  observer_list)

Updates the passed reference of observer_list with all observers The original content of the list is cleared.

Returns
void

Definition at line 541 of file ksuserdb.cpp.

◆ GetAllProfiles()

void KSUserDB::GetAllProfiles ( QList< std::shared_ptr< ProfileInfo >> &  profiles)

GetAllProfiles Return all profiles in a QList.

Returns
QMap with the keys as profile names and values are profile ids.

Definition at line 2010 of file ksuserdb.cpp.

◆ GetAllScopes()

void KSUserDB::GetAllScopes ( QList< OAL::Scope * > &  m_scopeList)

updates the scope list with all scopes from database List is cleared and then filled with content.

Parameters
m_scopeListReference to list to be updated
Returns
void

Definition at line 1076 of file ksuserdb.cpp.

◆ Initialize()

bool KSUserDB::Initialize ( )

Initialize KStarsDB while running splash screen.

Returns
true on success

Definition at line 40 of file ksuserdb.cpp.

◆ UpdateDarkFrame()

void KSUserDB::UpdateDarkFrame ( const QVariantMap &  oneFrame)

KSUserDB::UpdateDarkFrame Updates an existing dark frame record in the data, replace all values matching the supplied ID.

Parameters
oneFramedark frame to update. The ID should already exist in the database.

Definition at line 595 of file ksuserdb.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Aug 9 2022 04:06:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.