Stellarium 0.15.2
|
Main class of the Satellites plugin. More...
#include <Satellites.hpp>
Public Types | |
enum | UpdateState { Updating, CompleteNoUpdates, CompleteUpdates, DownloadError, OtherError } |
Used for keeping track of the download/update status. More... | |
enum | Status { Visible, NotVisible, Both, NewlyAdded, OrbitError } |
Flags used to filter the satellites list according to their status. More... | |
Public Types inherited from StelModule | |
enum | StelModuleSelectAction { AddToSelection, ReplaceSelection, RemoveFromSelection } |
Enum used when selecting objects to define whether to add to, replace, or remove from the existing selection list. More... | |
enum | StelModuleActionName { ActionDraw, ActionUpdate, ActionHandleMouseClicks, ActionHandleMouseMoves, ActionHandleKeys } |
Define the possible action for which an order is defined. More... | |
Public Slots | |
void | enableInternetUpdates (bool enabled=true) |
Set whether the plugin will try to download updates from the Internet. More... | |
void | enableAutoAdd (bool enabled=true) |
Emits settingsChanged() if the value changes. More... | |
void | enableAutoRemove (bool enabled=true) |
Emits settingsChanged() if the value changes. More... | |
void | setFlagHints (bool b) |
Set whether satellite position hints (icons) should be displayed. More... | |
void | setFlagLabels (bool b) |
Set whether text labels should be displayed next to satellite hints. More... | |
void | setFlagRelisticMode (bool b) |
Emits settingsChanged() if the value changes. More... | |
void | setLabelFontSize (int size) |
set the label font size. More... | |
void | setUpdateFrequencyHours (int hours) |
Set the Internet update frequency. More... | |
void | updateFromOnlineSources () |
Start an Internet update. More... | |
void | setOrbitLinesFlag (bool b) |
Choose whether or not to draw orbit lines. More... | |
void | recalculateOrbitLines (void) |
void | displayMessage (const QString &message, const QString hexColor="#999999") |
Display a message on the screen for a few seconds. More... | |
void | hideMessages () |
Hide all messages. More... | |
void | saveCatalog (QString path=QString()) |
Save the current satellite catalog to disk. More... | |
void | setIridiumFlaresPredictionDepth (int depth) |
Set depth of prediction for Iridium flares. More... | |
Signals | |
void | hintsVisibleChanged (bool b) |
void | labelsVisibleChanged (bool b) |
void | settingsChanged () |
Emitted when some of the plugin settings have been changed. More... | |
void | updateStateChanged (Satellites::UpdateState state) |
emitted when the update status changes, e.g. More... | |
void | tleUpdateComplete (int updated, int total, int added, int missing) |
Emitted after an update has run. More... | |
Public Member Functions | |
virtual void | init () |
Initialize itself. More... | |
virtual void | deinit () |
Called before the module will be delete, and before the openGL context is suppressed. More... | |
virtual void | update (double deltaTime) |
Update the module with respect to the time. More... | |
virtual void | draw (StelCore *core) |
Execute all the drawing functions for this module. More... | |
virtual void | drawPointer (StelCore *core, StelPainter &painter) |
virtual double | getCallOrder (StelModuleActionName actionName) const |
Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations. More... | |
virtual QList< StelObjectP > | searchAround (const Vec3d &v, double limitFov, const StelCore *core) const |
Used to get a list of objects which are near to some position. More... | |
virtual StelObjectP | searchByNameI18n (const QString &nameI18n) const |
Return the matching satellite object's pointer if exists or NULL. More... | |
virtual StelObjectP | searchByName (const QString &name) const |
Return the matching satellite if exists or NULL. More... | |
StelObjectP | searchByNoradNumber (const QString &noradNumber) const |
Return the satellite with the given catalog number. More... | |
virtual QStringList | listMatchingObjects (const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false, bool inEnglish=false) const |
Find and return the list of at most maxNbItem objects auto-completing the passed object name. More... | |
virtual QStringList | listAllObjects (bool inEnglish) const |
List all StelObjects. More... | |
virtual QString | getName () const |
virtual bool | configureGui (bool show=true) |
Implment this to tell the main Stellarium GUi that there is a GUI element to configure this plugin. More... | |
void | restoreDefaults (void) |
Set up the plugin with default values. More... | |
void | loadSettings () |
Read (or re-read) the plugin's settings from the configuration file. More... | |
void | saveSettings () |
Save the plugin's settings to the main configuration file. More... | |
QSet< QString > | getGroups () const |
Get the groups used in the currently loaded satellite collection. More... | |
QStringList | getGroupIdList () const |
Get a sorted list of group names. More... | |
void | addGroup (const QString &groupId) |
Add this group to the global list. More... | |
QHash< QString, QString > | getSatellites (const QString &group=QString(), Status vis=Both) |
get satellite objects filtered by group. More... | |
SatellitesListModel * | getSatellitesListModel () |
Get a model representing the list of satellites. More... | |
SatelliteP | getById (const QString &id) |
Get a satellite object by its identifier (i.e. NORAD number). More... | |
QStringList | listAllIds () |
Returns a list of all satellite IDs. More... | |
void | add (const TleDataList &newSatellites) |
Add to the current collection the satellites described by the data list. More... | |
void | remove (const QStringList &idList) |
Remove the selected satellites. More... | |
bool | getUpdatesEnabled (void) |
get whether or not the plugin will try to update TLE data from the internet More... | |
QDateTime | getLastUpdate (void) |
get the date and time the TLE elements were updated More... | |
int | getUpdateFrequencyHours (void) |
get the update frequency in hours More... | |
int | getSecondsToUpdate (void) |
get the number of seconds till the next update More... | |
UpdateState | getUpdateState (void) |
get the update frequency in hours More... | |
QStringList | getTleSources (void) |
Get a list of URLs which are sources of TLE data. More... | |
void | setTleSources (QStringList tleSources) |
Set the list of URLs which are sources of TLE data. More... | |
void | saveTleSources (const QStringList &urls) |
Saves the current list of update URLs to the configuration file. More... | |
void | updateFromFiles (QStringList paths, bool deleteFiles=false) |
Reads update file(s) in celestrak's .txt format, and updates the TLE elements for exisiting satellites from them. More... | |
void | updateSatellites (TleDataHash &newTleSets) |
Updates the loaded satellite collection from the provided data. More... | |
void | parseQSMagFile (QString qsMagFile) |
Reads qs.mag file and its parsing for getting id and standard magnitude for satellites. More... | |
bool | getFlagHints () |
int | getLabelFontSize () |
get the label font size. More... | |
bool | getFlagLabels () |
bool | getFlagRealisticMode () |
bool | getOrbitLinesFlag () |
Get the current status of the orbit line rendering flag. More... | |
bool | isAutoAddEnabled () const |
bool | isAutoRemoveEnabled () const |
int | getIridiumFlaresPredictionDepth (void) |
Get depth of prediction for Iridium flares. More... | |
IridiumFlaresPredictionList | getIridiumFlaresPrediction () |
Public Member Functions inherited from StelObjectModule | |
virtual QStringList | listAllObjectsByType (const QString &objType, bool inEnglish) const |
List all StelObjects by type. More... | |
bool | matchObjectName (const QString &objName, const QString &objPrefix, bool useStartOfWords) const |
Auxiliary method of listMatchingObjects() More... | |
Public Member Functions inherited from StelModule | |
virtual QString | getModuleVersion () const |
Get the version of the module, default is stellarium main version. More... | |
virtual QString | getAuthorName () const |
Get the name of the module author. More... | |
virtual QString | getAuthorEmail () const |
Get the email adress of the module author. More... | |
virtual void | handleMouseClicks (class QMouseEvent *) |
Handle mouse clicks. More... | |
virtual void | handleMouseWheel (class QWheelEvent *) |
Handle mouse wheel. More... | |
virtual bool | handleMouseMoves (int x, int y, Qt::MouseButtons b) |
Handle mouse moves. More... | |
virtual void | handleKeys (class QKeyEvent *e) |
Handle key events. More... | |
virtual bool | handlePinch (qreal scale, bool started) |
Handle pinch gesture events. More... | |
Static Public Member Functions | |
static void | parseTleFile (QFile &openFile, TleDataHash &tleList, bool addFlagValue=false) |
Reads a TLE list from a file to the supplied hash. More... | |
Properties | |
bool | hintsVisible |
bool | labelsVisible |
bool | realisticMode |
Updater module | |
bool | autoAddEnabled |
Flag enabling the automatic addition of new satellites on update. More... | |
bool | autoRemoveEnabled |
Flag enabling the automatic removal of missing satellites on update. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from StelModule | |
class StelAction * | addAction (const QString &id, const QString &groupId, const QString &text, QObject *target, const char *slot, const QString &shortcut="", const QString &altShortcut="") |
convenience methods to add an action (call to slot) to the StelActionMgr object. More... | |
class StelAction * | addAction (const QString &id, const QString &groupId, const QString &text, const char *slot, const QString &shortcut="", const QString &altShortcut="") |
convenience methods to add an action (call to own slot) to the StelActionMgr object. More... | |
Main class of the Satellites plugin.
Definition at line 144 of file Satellites.hpp.
enum Satellites::Status |
Flags used to filter the satellites list according to their status.
Definition at line 180 of file Satellites.hpp.
Used for keeping track of the download/update status.
Definition at line 170 of file Satellites.hpp.
void Satellites::add | ( | const TleDataList & | newSatellites | ) |
Add to the current collection the satellites described by the data list.
The changes are not saved to file. Calls add(TleData).
void Satellites::addGroup | ( | const QString & | groupId | ) |
Add this group to the global list.
|
virtual |
Implment this to tell the main Stellarium GUi that there is a GUI element to configure this plugin.
Reimplemented from StelModule.
|
virtual |
Called before the module will be delete, and before the openGL context is suppressed.
Deinitialize all openGL texture in this method.
Reimplemented from StelModule.
|
slot |
Display a message on the screen for a few seconds.
This is used for plugin-specific warnings and such.
|
virtual |
Execute all the drawing functions for this module.
core | the core to use for the drawing |
Reimplemented from StelModule.
|
slot |
Emits settingsChanged() if the value changes.
|
slot |
Emits settingsChanged() if the value changes.
|
slot |
Set whether the plugin will try to download updates from the Internet.
Emits settingsChanged() if the value changes.
b | if true, updates will be enabled, else they will be disabled. |
SatelliteP Satellites::getById | ( | const QString & | id | ) |
Get a satellite object by its identifier (i.e. NORAD number).
|
virtual |
Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.
actionName | the name of the action for which we want the call order |
Reimplemented from StelModule.
QStringList Satellites::getGroupIdList | ( | ) | const |
Get a sorted list of group names.
See groups for details. Use getGroups() if you don't need a list.
QSet<QString> Satellites::getGroups | ( | ) | const |
Get the groups used in the currently loaded satellite collection.
See groups for details. Use getGroupIdList() if you need a list.
|
inline |
Get depth of prediction for Iridium flares.
Definition at line 373 of file Satellites.hpp.
|
inline |
get the label font size.
Definition at line 364 of file Satellites.hpp.
|
inline |
get the date and time the TLE elements were updated
Definition at line 288 of file Satellites.hpp.
bool Satellites::getOrbitLinesFlag | ( | ) |
Get the current status of the orbit line rendering flag.
QHash<QString,QString> Satellites::getSatellites | ( | const QString & | group = QString() , |
Status | vis = Both |
||
) |
get satellite objects filtered by group.
If an empty string is used for the group name, return all satallites
SatellitesListModel* Satellites::getSatellitesListModel | ( | ) |
Get a model representing the list of satellites.
int Satellites::getSecondsToUpdate | ( | void | ) |
get the number of seconds till the next update
|
inline |
Get a list of URLs which are sources of TLE data.
Definition at line 305 of file Satellites.hpp.
|
inline |
get the update frequency in hours
Definition at line 291 of file Satellites.hpp.
|
inline |
get whether or not the plugin will try to update TLE data from the internet
Definition at line 285 of file Satellites.hpp.
|
inline |
get the update frequency in hours
Get the current updateState
Definition at line 300 of file Satellites.hpp.
|
slot |
Hide all messages.
|
virtual |
Initialize itself.
If the initialization takes significant time, the progress should be displayed on the loading bar.
Implements StelModule.
QStringList Satellites::listAllIds | ( | ) |
Returns a list of all satellite IDs.
|
virtual |
List all StelObjects.
inEnglish | list names in English (true) or translated (false) |
Implements StelObjectModule.
|
virtual |
Find and return the list of at most maxNbItem objects auto-completing the passed object name.
objPrefix | the case insensitive first letters of the searched object |
maxNbItem | the maximum number of returned object names |
useStartOfWords | the autofill mode for returned objects names |
Reimplemented from StelObjectModule.
void Satellites::loadSettings | ( | ) |
Read (or re-read) the plugin's settings from the configuration file.
This will be called from init() and also when restoring defaults (i.e. from the configuration dialog / restore defaults button).
void Satellites::parseQSMagFile | ( | QString | qsMagFile | ) |
Reads qs.mag file and its parsing for getting id and standard magnitude for satellites.
name | of file |
|
static |
Reads a TLE list from a file to the supplied hash.
If an entry with the same ID exists in the given hash, its contents are overwritten with the new values.
openFile | a reference to an open file. | |
[in,out] | tleList | a hash with satellite IDs as keys. |
[in] | addFlagValue | value to be set to TleData::addThis for all. |
void Satellites::remove | ( | const QStringList & | idList | ) |
Remove the selected satellites.
The changes are not saved to file.
void Satellites::restoreDefaults | ( | void | ) |
Set up the plugin with default values.
This means clearing out the Satellites section in the main config.ini (if one already exists), and populating it with default values. It also creates the default satellites.json file from the resource embedded in the plugin lib/dll file.
|
slot |
Save the current satellite catalog to disk.
void Satellites::saveSettings | ( | ) |
Save the plugin's settings to the main configuration file.
void Satellites::saveTleSources | ( | const QStringList & | urls | ) |
Saves the current list of update URLs to the configuration file.
|
virtual |
Used to get a list of objects which are near to some position.
v | a vector representing the position in th sky around which to search for nebulae. |
limitFov | the field of view around the position v in which to search for satellites. |
core | the StelCore to use for computations. |
Implements StelObjectModule.
|
virtual |
Return the matching satellite if exists or NULL.
name | The case in-sensistive standard program name |
Implements StelObjectModule.
|
virtual |
Return the matching satellite object's pointer if exists or NULL.
nameI18n | The case in-sensistive satellite name |
Implements StelObjectModule.
StelObjectP Satellites::searchByNoradNumber | ( | const QString & | noradNumber | ) | const |
Return the satellite with the given catalog number.
Used as a helper function by searchByName() and searchByNameI18n().
noradNumber | search string in the format "NORAD XXXX". |
|
slot |
Set whether satellite position hints (icons) should be displayed.
Note that hint visibility also applies to satellite labels. Emits settingsChanged() if the value changes.
|
slot |
Set whether text labels should be displayed next to satellite hints.
Emits settingsChanged() if the value changes.
|
slot |
Emits settingsChanged() if the value changes.
|
inlineslot |
Set depth of prediction for Iridium flares.
depth | in days |
Definition at line 470 of file Satellites.hpp.
|
slot |
set the label font size.
size | the pixel size of the font Emits settingsChanged() if the value changes. |
|
slot |
Choose whether or not to draw orbit lines.
Each satellite has its own setting as well, but this can be used to turn on/off all those satellites which elect to have orbit lines all in one go.
b | - true to turn on orbit lines, false to turn off |
|
signal |
Emitted when some of the plugin settings have been changed.
Used to communicate with the configuration window.
void Satellites::setTleSources | ( | QStringList | tleSources | ) |
Set the list of URLs which are sources of TLE data.
In addition to replacing the current list of sources, it also saves them to the configuration file. Allows marking sources for auto-addition by adding a prefix to the URL string.
|
slot |
Set the Internet update frequency.
Emits settingsChanged() if the value changes.
|
signal |
Emitted after an update has run.
updated | the number of updated satellites; |
total | the total number of satellites in the catalog; |
added | the number of newly added satellites; |
missing | the number of satellites that were not found in the update source(s) (and were removed, if autoRemoveEnabled is set). |
|
virtual |
Update the module with respect to the time.
deltaTime | the time increment in second since last call. |
Implements StelModule.
void Satellites::updateFromFiles | ( | QStringList | paths, |
bool | deleteFiles = false |
||
) |
Reads update file(s) in celestrak's .txt format, and updates the TLE elements for exisiting satellites from them.
Indirectly emits signals updateStateChanged() and tleUpdateComplete(), as it calls updateSatellites(). See updateFromOnlineSources() for the other kind of update operation.
paths | a list of paths to update files |
deleteFiles | if set, the update files are deleted after they are used, else they are left alone |
|
slot |
Start an Internet update.
This method starts the process of an Internet update: it tries to download TLE lists from online recources and then use them to update the orbital data (and names, etc.) of the included satellites. This only initialized the download. The rest of the work is done by saveDownloadedUpdate() and updateSatellites(). Update sources are described in updateUrls (see for accessor details). If autoAddEnabled is true when this function is called, new satellites in the chosen update sources will be added during the update. If autoRemoveEnabled is true when this function is called, any existing satellite that can't be found in the downloaded update lists will be removed. See updateFromFiles() for the other type of update operation.
void Satellites::updateSatellites | ( | TleDataHash & | newTleSets | ) |
Updates the loaded satellite collection from the provided data.
Worker function called by updateFromFiles() and saveDownloadedUpdate(). (Respecitvely, user-initiated update from file(s) and user- or auto- initiated update from online source(s).) Emits updateStateChanged() and tleUpdateComplete().
[in,out] | newTleSets | a hash with satellite IDs as keys; it's modified by the method! |
|
signal |
emitted when the update status changes, e.g.
when an update starts, completes and so on. Note that on completion of an update, tleUpdateComplete is also emitted with the number of updates done.
state | the new update state. |
|
readwrite |
Flag enabling the automatic addition of new satellites on update.
This will apply only for the selected update sources.
Definition at line 158 of file Satellites.hpp.
|
readwrite |
Flag enabling the automatic removal of missing satellites on update.
Definition at line 162 of file Satellites.hpp.