KStarsData

Search for usage in LXR

#include <kstarsdata.h>

Inheritance diagram for KStarsData:

Signals

void clearCache ()
 
void geoChanged ()
 
void progressText (const QString &text)
 
void skyUpdate (bool)
 

Public Slots

std::pair< bool, QStringaddToUserData (const QString &name, const SkyObjectUserdata::LinkData &data)
 
std::pair< bool, QStringdeleteUserData (const QString &name, const unsigned int index, SkyObjectUserdata::Type type)
 
std::pair< bool, QStringeditUserData (const QString &name, const unsigned int index, const SkyObjectUserdata::LinkData &data)
 
const SkyObjectUserdata::DatagetUserData (const QString &name)
 
void setTimeDirection (float scale)
 
void slotConsoleMessage (QString s)
 
void updateTime (GeoLocation *geo, const bool automaticDSTchange=true)
 
std::pair< bool, QStringupdateUserLog (const QString &name, const QString &newLog)
 

Public Member Functions

 ~KStarsData () override
 
void add_color_scheme (const QString &filename, const QString &name)
 
void addTransientFOV (std::shared_ptr< FOV > newFOV)
 
QList< ADVTreeData * > avdTree ()
 
void changeDateTime (const KStarsDateTime &newDate)
 
void clearTransientFOVs ()
 
Q_INVOKABLE SimClockclock ()
 
const std::map< QString, QStringcolor_schemes ()
 
ColorSchemecolorScheme ()
 
Q_INVOKABLE QString colorSchemeFileName ()
 
QString colorSchemeFileName (const QString &name)
 
Q_INVOKABLE QString colorSchemeName ()
 
QString colorSchemeName (const QString &fileName)
 
bool executeScript (const QString &name, SkyMap *map)
 
ExecuteexecuteSession ()
 
GeoLocationgeo ()
 
const QList< FOV * > getAvailableFOVs () const
 
QList< GeoLocation * > & getGeoList ()
 
const QMap< QString, TimeZoneRule > & getRulebook () const
 
const QList< std::shared_ptr< FOV > > getTransientFOVs () const
 
const QList< FOV * > getVisibleFOVs () const
 
bool hasColorScheme (const QString &scheme)
 
ImageExporterimageExporter ()
 
unsigned int incUpdateID ()
 
bool initialize ()
 
bool isTimeRunningForward () const
 
GeoLocationlocationNamed (const QString &city, const QString &province=QString(), const QString &country=QString())
 
OAL::Log * logObject ()
 
CachingDmslst ()
 
const KStarsDateTimelt () const
 
GeoLocationnearestLocation (double longitude, double latitude)
 
SkyObjectobjectNamed (const QString &name)
 
ObservingListobservingList () const
 
void setFullTimeUpdate ()
 
void setLocation (const GeoLocation &l)
 
void setLocationFromOptions ()
 
void setNextDSTChange (const KStarsDateTime &dt)
 
void setSnapNextFocus (bool b=true)
 
SkyMapCompositeskyComposite ()
 
bool snapNextFocus () const
 
void syncFOV ()
 
void syncLST ()
 
void syncUpdateIDs ()
 
unsigned int updateID () const
 
KSNumbersupdateNum ()
 
unsigned int updateNumID () const
 
KSUserDBuserdb ()
 
const KStarsDateTimeut () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static KStarsDataCreate ()
 
static KStarsDataInstance ()
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Protected Member Functions

 KStarsData ()
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Public Attributes inherited from QObject
typedef QObjectList
 

Detailed Description

KStarsData is the backbone of KStars. It contains all the data used by KStars, including the SkyMapComposite that contains all items in the skymap (stars, deep-sky objects, planets, constellations, etc). Other kinds of data are stored here as well: the geographic locations, the timezone rules, etc.

Author
Heiko Evermann
Version
1.0

Definition at line 70 of file kstarsdata.h.

Constructor & Destructor Documentation

◆ KStarsData()

KStarsData::KStarsData ( )
protected

Constructor.

Definition at line 105 of file kstarsdata.cpp.

◆ ~KStarsData()

KStarsData::~KStarsData ( )
override

Destructor.

Delete data objects.

Definition at line 118 of file kstarsdata.cpp.

Member Function Documentation

◆ add_color_scheme()

void KStarsData::add_color_scheme ( const QString filename,
const QString name 
)
inline

Register a color scheme with filename and name.

Definition at line 204 of file kstarsdata.h.

◆ addToUserData

std::pair< bool, QString > KStarsData::addToUserData ( const QString name,
const SkyObjectUserdata::LinkData data 
)
slot

Adds a link data to the user data for the object with name, both in memory and on disk.

Returns
{success, error_message}

Definition at line 1531 of file kstarsdata.cpp.

◆ addTransientFOV()

void KStarsData::addTransientFOV ( std::shared_ptr< FOV newFOV)
inline

addTransientFOV Adds a new FOV to the list.

Parameters
newFOVpointer to FOV object.

Definition at line 322 of file kstarsdata.h.

◆ avdTree()

QList<ADVTreeData *> KStarsData::avdTree ( )
inline

Return ADV Tree.

Definition at line 346 of file kstarsdata.h.

◆ changeDateTime()

void KStarsData::changeDateTime ( const KStarsDateTime newDate)

Change the current simulation date/time to the KStarsDateTime argument.

Specified DateTime is always universal time.

Parameters
newDatethe DateTime to set.

Definition at line 327 of file kstarsdata.cpp.

◆ clearCache

void KStarsData::clearCache ( )
signal

If data changed, emit clearCache signal.

◆ clock()

Q_INVOKABLE SimClock* KStarsData::clock ( )
inline
Returns
pointer to the simulation Clock object

Definition at line 217 of file kstarsdata.h.

◆ color_schemes()

const std::map<QString, QString> KStarsData::color_schemes ( )
inline
Returns
a map of color scheme names and filenames

Definition at line 211 of file kstarsdata.h.

◆ colorScheme()

ColorScheme* KStarsData::colorScheme ( )
inline
Returns
pointer to the ColorScheme object

Definition at line 171 of file kstarsdata.h.

◆ colorSchemeFileName() [1/2]

Q_INVOKABLE QString KStarsData::colorSchemeFileName ( )
inline
Returns
file name of current color scheme

Definition at line 177 of file kstarsdata.h.

◆ colorSchemeFileName() [2/2]

QString KStarsData::colorSchemeFileName ( const QString name)
inline
Returns
file name of the color scheme with the name name

Definition at line 180 of file kstarsdata.h.

◆ colorSchemeName() [1/2]

Q_INVOKABLE QString KStarsData::colorSchemeName ( )
inline
Returns
file name of the current color scheme

Definition at line 186 of file kstarsdata.h.

◆ colorSchemeName() [2/2]

QString KStarsData::colorSchemeName ( const QString fileName)
inline
Returns
the name of the color scheme with the name name

Definition at line 192 of file kstarsdata.h.

◆ deleteUserData

std::pair< bool, QString > KStarsData::deleteUserData ( const QString name,
const unsigned int  index,
SkyObjectUserdata::Type  type 
)
slot

Remove data of type from the user data at index for the object with name, both in memory and on disk.

Returns
{success, error_message}

Definition at line 1668 of file kstarsdata.cpp.

◆ editUserData

std::pair< bool, QString > KStarsData::editUserData ( const QString name,
const unsigned int  index,
const SkyObjectUserdata::LinkData data 
)
slot

Replace data in the user data at index for the object with name, both in memory and on disk.

Returns
{success, error_message}

Definition at line 1646 of file kstarsdata.cpp.

◆ executeScript()

bool KStarsData::executeScript ( const QString name,
SkyMap map 
)

Execute a script.

This function actually duplicates the DCOP functionality for those cases when invoking DCOP is not practical (i.e., when preparing a sky image in command-line dump mode).

Parameters
namethe filename of the script to "execute".
mappointer to the SkyMap object.
Returns
true if the script was successfully parsed.

Definition at line 912 of file kstarsdata.cpp.

◆ geo()

GeoLocation* KStarsData::geo ( )
inline
Returns
pointer to the GeoLocation object

Definition at line 229 of file kstarsdata.h.

◆ geoChanged

void KStarsData::geoChanged ( )
signal

Emitted when geo location changed.

◆ getAvailableFOVs()

const QList<FOV *> KStarsData::getAvailableFOVs ( ) const
inline
Returns
the list of available FOVs

Definition at line 313 of file kstarsdata.h.

◆ getGeoList()

QList<GeoLocation *>& KStarsData::getGeoList ( )
inline
Returns
list of all geographic locations

Definition at line 235 of file kstarsdata.h.

◆ getRulebook()

const QMap<QString, TimeZoneRule>& KStarsData::getRulebook ( ) const
inline

Return map for daylight saving rules.

Definition at line 261 of file kstarsdata.h.

◆ getTransientFOVs()

const QList<std::shared_ptr<FOV> > KStarsData::getTransientFOVs ( ) const
inline
Returns
the list of transient FOVs

Definition at line 334 of file kstarsdata.h.

◆ getUserData

const SkyObjectUserdata::Data & KStarsData::getUserData ( const QString name)
slot

Get a reference to the user data of an object with the name name.

Definition at line 1755 of file kstarsdata.cpp.

◆ getVisibleFOVs()

const QList<FOV *> KStarsData::getVisibleFOVs ( ) const
inline
Returns
the list of visible FOVs

Definition at line 305 of file kstarsdata.h.

◆ hasColorScheme()

bool KStarsData::hasColorScheme ( const QString scheme)
inline
Returns
if the color scheme with the name or filename scheme is loaded

Definition at line 198 of file kstarsdata.h.

◆ initialize()

bool KStarsData::initialize ( )

Initialize KStarsData while running splash screen.

Returns
true on success.

This code to add Height column to table city in mycitydb.sqlite is a transitional measure to support a meaningful geographic elevation.

Definition at line 131 of file kstarsdata.cpp.

◆ isTimeRunningForward()

bool KStarsData::isTimeRunningForward ( ) const
inline

Returns true if time is running forward else false.

Used by KStars to prevent double calculations of daylight saving change time.

Definition at line 118 of file kstarsdata.h.

◆ logObject()

OAL::Log* KStarsData::logObject ( )
inline

Return log object.

Definition at line 340 of file kstarsdata.h.

◆ lst()

CachingDms* KStarsData::lst ( )
inline
Returns
pointer to the local sidereal time: a dms object

Definition at line 223 of file kstarsdata.h.

◆ lt()

const KStarsDateTime& KStarsData::lt ( ) const
inline
Returns
pointer to the current simulation local time

Definition at line 150 of file kstarsdata.h.

◆ nearestLocation()

GeoLocation * KStarsData::nearestLocation ( double  longitude,
double  latitude 
)

nearestLocation Return nearest location to the given longitude and latitude coordinates

Parameters
longitudeLongitude (-180 to +180)
latitudeLatitude (-90 to +90)
Returns
nearest geographical location to the parameters above.

Definition at line 377 of file kstarsdata.cpp.

◆ objectNamed()

SkyObject * KStarsData::objectNamed ( const QString name)

Find object by name.

Returns
pointer to the localization (KLocale) object
Parameters
nameObject name to find
Returns
pointer to SkyObject matching this name

Definition at line 429 of file kstarsdata.cpp.

◆ progressText

void KStarsData::progressText ( const QString text)
signal

Signal that specifies the text that should be drawn in the KStarsSplash window.

◆ setFullTimeUpdate()

void KStarsData::setFullTimeUpdate ( )

The Sky is updated more frequently than the moon, which is updated more frequently than the planets.

The date of the last update for each category is recorded so we know when we need to do it again (see KStars::updateTime()). Initializing these to -1000000.0 ensures they will be updated immediately on the first call to KStars::updateTime().

Definition at line 313 of file kstarsdata.cpp.

◆ setLocation()

void KStarsData::setLocation ( const GeoLocation l)

Set the GeoLocation according to the argument.

Parameters
lreference to the new GeoLocation

Definition at line 403 of file kstarsdata.cpp.

◆ setLocationFromOptions()

void KStarsData::setLocationFromOptions ( )

Set the GeoLocation according to the values stored in the configuration file.

Definition at line 396 of file kstarsdata.cpp.

◆ setNextDSTChange()

void KStarsData::setNextDSTChange ( const KStarsDateTime dt)
inline

Set the NextDSTChange member.

Need this accessor because I could not make KStars::privatedata a friend class for some reason...:/

Definition at line 109 of file kstarsdata.h.

◆ setSnapNextFocus()

void KStarsData::setSnapNextFocus ( bool  b = true)
inline

Disable or re-enable the slewing animation for the next Focus change.

Note
If the user has turned off all animated slewing, setSnapNextFocus(false) will NOT enable animation on the next slew. A false argument would only be used if you have previously called setSnapNextFocus(true), but then decided you didn't want that after all. In other words, it's extremely unlikely you'd ever want to use setSnapNextFocus(false).
Parameters
bwhen true (the default), the next Focus change will omit the slewing animation.

Definition at line 282 of file kstarsdata.h.

◆ setTimeDirection

void KStarsData::setTimeDirection ( float  scale)
slot

Sets the direction of time and stores it in bool TimeRunForwards.

If scale >= 0 time is running forward else time runs backward. We need this to calculate just one daylight saving change time (previous or next DST change).

Definition at line 359 of file kstarsdata.cpp.

◆ skyComposite()

SkyMapComposite* KStarsData::skyComposite ( )
inline
Returns
pointer to SkyComposite

Definition at line 165 of file kstarsdata.h.

◆ skyUpdate

void KStarsData::skyUpdate ( bool  )
signal

Should be used to refresh skymap.

◆ slotConsoleMessage

void KStarsData::slotConsoleMessage ( QString  s)
inlineslot

send a message to the console

Definition at line 392 of file kstarsdata.h.

◆ snapNextFocus()

bool KStarsData::snapNextFocus ( ) const
inline
Returns
whether the next Focus change will omit the slewing animation.

Definition at line 267 of file kstarsdata.h.

◆ syncFOV()

void KStarsData::syncFOV ( )

Synchronize list of visible FOVs and list of selected FOVs in Options.

Definition at line 1487 of file kstarsdata.cpp.

◆ syncLST()

void KStarsData::syncLST ( )

Sync the LST with the simulation clock.

Definition at line 322 of file kstarsdata.cpp.

◆ updateTime

void KStarsData::updateTime ( GeoLocation geo,
const bool  automaticDSTchange = true 
)
slot

Update the Simulation Clock.

Update positions of Planets. Update Alt/Az coordinates of objects. Update precession. emit the skyUpdate() signal so that SkyMap / whatever draws the sky can update itself

This is ugly. It will change! (JH:)hey, it's much less ugly now...can we lose the comment yet? :p

Definition at line 234 of file kstarsdata.cpp.

◆ updateUserLog

std::pair< bool, QString > KStarsData::updateUserLog ( const QString name,
const QString newLog 
)
slot

Update the user log of the object with the name to contain newLog (find and replace).

Returns
{success, error_message}

Definition at line 1691 of file kstarsdata.cpp.

◆ userdb()

KSUserDB* KStarsData::userdb ( )
inline
Returns
pointer to the KSUserDB object

Definition at line 214 of file kstarsdata.h.

◆ ut()

const KStarsDateTime& KStarsData::ut ( ) const
inline
Returns
reference to the current simulation universal time

Definition at line 156 of file kstarsdata.h.


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 Thu Dec 8 2022 03:59:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.