Stellarium 0.14.3
|
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 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... | |
Signals | |
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 () |
virtual void | deinit () |
virtual void | update (double deltaTime) |
virtual void | draw (StelCore *core) |
virtual void | drawPointer (StelCore *core, StelPainter &painter) |
virtual double | getCallOrder (StelModuleActionName actionName) const |
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 | listMatchingObjectsI18n (const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const |
Find and return the list of at most maxNbItem objects auto-completing the passed object I18n name. More... | |
virtual QStringList | listMatchingObjects (const QString &objPrefix, int maxNbItem=5, bool useStartOfWords=false) const |
Find and return the list of at most maxNbItem objects auto-completing the passed object English name. More... | |
virtual QStringList | listAllObjects (bool inEnglish) const |
virtual QStringList | listAllObjectsByType (const QString &objType, bool inEnglish) const |
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 |
IridiumFlaresPredictionList | getIridiumFlaresPrediction () |
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... | |
Main class of the Satellites plugin.
Definition at line 143 of file Satellites.hpp.
enum Satellites::Status |
Flags used to filter the satellites list according to their status.
Definition at line 177 of file Satellites.hpp.
Used for keeping track of the download/update status.
Definition at line 167 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.
|
slot |
Display a message on the screen for a few seconds.
This is used for plugin-specific warnings and such.
|
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).
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 the label font size.
Definition at line 369 of file Satellites.hpp.
|
inline |
get the date and time the TLE elements were updated
Definition at line 293 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 310 of file Satellites.hpp.
|
inline |
get the update frequency in hours
Definition at line 296 of file Satellites.hpp.
|
inline |
get whether or not the plugin will try to update TLE data from the internet
Definition at line 290 of file Satellites.hpp.
|
inline |
get the update frequency in hours
Get the current updateState
Definition at line 305 of file Satellites.hpp.
|
slot |
Hide all messages.
QStringList Satellites::listAllIds | ( | ) |
Returns a list of all satellite IDs.
|
virtual |
Find and return the list of at most maxNbItem objects auto-completing the passed object English 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 |
Implements StelObjectModule.
|
virtual |
Find and return the list of at most maxNbItem objects auto-completing the passed object I18n 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 |
Implements 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.
|
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). |
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. |