Satellites.hpp   Satellites.hpp 
skipping to change at line 31 skipping to change at line 31
#include "StelObjectModule.hpp" #include "StelObjectModule.hpp"
#include "Satellite.hpp" #include "Satellite.hpp"
#include "StelFader.hpp" #include "StelFader.hpp"
#include "StelGui.hpp" #include "StelGui.hpp"
#include "StelDialog.hpp" #include "StelDialog.hpp"
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include <QDateTime> #include <QDateTime>
#include <QFile> #include <QFile>
#include <QSharedPointer> #include <QDir>
#include <QUrl>
#include <QVariantMap> #include <QVariantMap>
class StelButton; class StelButton;
class Planet; class Planet;
class QNetworkAccessManager; class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class QPixmap; class QPixmap;
class QProgressBar; class QProgressBar;
class QSettings; class QSettings;
class QTimer; class QTimer;
class SatellitesDialog;
typedef QSharedPointer<Satellite> SatelliteP; class SatellitesDialog;
class SatellitesListModel;
//! Data structure containing unvalidated TLE set as read from a TLE list f ile. //! Data structure containing unvalidated TLE set as read from a TLE list f ile.
struct TleData struct TleData
{ {
//! NORAD catalog number, as extracted from the TLE set. //! NORAD catalog number, as extracted from the TLE set.
QString id; QString id;
//! Human readable name, as extracted from the TLE title line. //! Human readable name, as extracted from the TLE title line.
QString name; QString name;
QString first; QString first;
QString second; QString second;
//! Flag indicating whether this satellite should be added.
//! See Satellites::autoAddEnabled.
bool addThis;
}; };
typedef QList<TleData> TleDataList; typedef QList<TleData> TleDataList;
typedef QHash<QString, TleData> TleDataHash ; typedef QHash<QString, TleData> TleDataHash ;
//! TLE update source, used only internally for now.
struct TleSource
{
//! URL from where the source list should be downloaded.
QUrl url;
//! The downloaded file, location set after finishing download.
//! In the future may be a QTemporaryFile object.
QFile* file;
//! Flag indicating whether new satellites in this list should be ad
ded.
//! See Satellites::autoAddEnabled.
bool addNew;
};
typedef QList<TleSource> TleSourceList;
/*! @mainpage notitle
@section overview Plugin Overview
The %Satellites plugin displays the positions of artifical satellites in Ea
rth
orbit based on a catalog of orbital data.
The Satellites class is the main class of the plug-in. It manages a collect
ion
of Satellite objects and takes care of loading, saving and updating the
satellite catalog. It allows automatic updates from online sources and mana
ges
a list of update file URLs.
To calculate satellite positions, the plugin uses an implementation of
the SGP4/SDP4 algorithms (J.L. Canales' gsat library).
@section satprop Satellite Properties
@subsection ident Name and identifiers
Each satellite has a name. It's displayed as a label of the satellite hint
and in the list of satellites. Names are not unique though, so they are use
d only
for presentation purposes.
In the @ref satcat satellites are uniquely identified by their NORAD number
, which is encoded in TLEs.
@subsection groups Grouping
A satellite can belong to one or more groups such as "amateur", "geostation
ary" or "navigation". They have no other function but to help the user orga
nize the satellite collection.
Group names are arbitrary strings defined in the @ref satcat for each satel
lite and are more similar to the concept of "tags" than a hierarchical grou
ping. A satellite may not belong to any group at all.
By convention, group names are in lowercase. The GUI translates some of the
groups used in the default catalog.
@section satcat Satellite Catalog
The satellite catalog is stored on the disk in [JSON](http://www.json.org/)
format, in a file named "satellites.json". A default copy is embedded in th
e
plug-in at compile time. A working copy is kept in the user data directory.
@section config Configuration
The plug-ins' configuration data is stored in Stellarium's main configurati
on
file.
*/
//! @class Satellites //! @class Satellites
//! Satellites in low Earth orbit require different orbital calculations fr //! Main class of the %Satellites plugin.
om planets, the moon //! @author Matthew Gates
//! and so on. This plugin implements the SGP4/SDP4 algorithms in Stellari //! @author Bogdan Marinov
um, allowing accurate
//! prediction of the position of artificial satellites.
class Satellites : public StelObjectModule class Satellites : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool autoAddEnabled
READ isAutoAddEnabled
WRITE enableAutoAdd
NOTIFY settingsChanged)
Q_PROPERTY(bool autoRemoveEnabled
READ isAutoRemoveEnabled
WRITE enableAutoRemove
NOTIFY settingsChanged)
public: public:
//! @enum UpdateState //! @enum UpdateState
//! Used for keeping track of the download/update status //! Used for keeping track of the download/update status
enum UpdateState enum UpdateState
{ {
Updating, //!< Update in progress Updating, //!< Update in progress
CompleteNoUpdates, //!< Update completed, there we no upd ates CompleteNoUpdates, //!< Update completed, there we no upd ates
CompleteUpdates, //!< Update completed, there were upda tes CompleteUpdates, //!< Update completed, there were upda tes
DownloadError, //!< Error during download phase DownloadError, //!< Error during download phase
OtherError //!< Other error OtherError //!< Other error
}; };
//! Flags used to filter the satellites list according to their stat us.
enum Status enum Status
{ {
Visible, Visible,
NotVisible, NotVisible,
Both, Both,
NewlyAdded, NewlyAdded,
OrbitError OrbitError
}; };
Satellites(); Satellites();
skipping to change at line 149 skipping to change at line 217
//! Implment this to tell the main Stellarium GUi that there is a GU I element to configure this //! Implment this to tell the main Stellarium GUi that there is a GU I element to configure this
//! plugin. //! plugin.
virtual bool configureGui(bool show=true); virtual bool configureGui(bool show=true);
//! Set up the plugin with default values. This means clearing out the Satellites section in the //! 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 //! main config.ini (if one already exists), and populating it with default values. It also
//! creates the default satellites.json file from the resource embed ded in the plugin lib/dll file. //! creates the default satellites.json file from the resource embed ded in the plugin lib/dll file.
void restoreDefaults(void); void restoreDefaults(void);
//! Read (or re-read) settings from the main config file. This will //! Read (or re-read) the plugin's settings from the configuration f
be called from init and also ile.
//! when restoring defaults (i.e. from the configuration dialog / re //! This will be called from init() and also when restoring defaults
store defaults button). //! (i.e. from the configuration dialog / restore defaults button).
void readSettingsFromConfig(void); void loadSettings();
//! Save the settings to the main configuration file. //! Save the plugin's settings to the main configuration file.
void saveSettingsToConfig(void); void saveSettings();
//! Get a list of satellite group names. A Satellite may be long to //! Get the groups used in the currently loaded satellite collection
one or more group .
//! e.g. "amateur" and "navigation". Group names are arbitrary stri //! See @ref groups for details. Use getGroupIdList() if you need a
ngs defined in the list.
//! json file. Think of them like tags. A satellite may not belong QSet<QString> getGroups() const;
to any group at all. //! Get a sorted list of group names.
QStringList getGroups(void) const; //! See @ref groups for details. Use getGroups() if you don't need a
list.
QStringList getGroupIdList() const;
//! Add this group to the global list.
void addGroup(const QString& groupId);
//! get satellite objects filtered by group. If an empty string is used for the //! get satellite objects filtered by group. If an empty string is used for the
//! group name, return all satallites //! group name, return all satallites
QHash<QString,QString> getSatellites(const QString& group=QString(), Status vis=Both); QHash<QString,QString> getSatellites(const QString& group=QString(), Status vis=Both);
//! Get a model representing the list of satellites.
SatellitesListModel* getSatellitesListModel();
//! get a satellite object by identifier //! Get a satellite object by its identifier (i.e. NORAD number).
SatelliteP getByID(const QString& id); SatelliteP getById(const QString& id);
//! Returns a list of all satellite IDs. //! Returns a list of all satellite IDs.
QStringList getAllIDs(); QStringList listAllIds();
//! Add the given satellites. //! Add to the current collection the satellites described by the da ta list.
//! The changes are not saved to file. //! The changes are not saved to file.
//! Calls add(TleData).
void add(const TleDataList& newSatellites); void add(const TleDataList& newSatellites);
//! Remove the selected satellites. //! Remove the selected satellites.
//! The changes are not saved to file. //! The changes are not saved to file.
void remove(const QStringList& idList); void remove(const QStringList& idList);
//! get whether or not the plugin will try to update TLE data from t he internet //! get whether or not the plugin will try to update TLE data from t he internet
//! @return true if updates are set to be done, false otherwise //! @return true if updates are set to be done, false otherwise
bool getUpdatesEnabled(void) {return updatesEnabled;} bool getUpdatesEnabled(void) {return updatesEnabled;}
//! set whether or not the plugin will try to update TLE data from t
he internet
//! @param b if true, updates will be enabled, else they will be dis
abled
void setUpdatesEnabled(bool b) {updatesEnabled=b;}
//! get the date and time the TLE elements were updated //! get the date and time the TLE elements were updated
QDateTime getLastUpdate(void) {return lastUpdate;} QDateTime getLastUpdate(void) {return lastUpdate;}
//! get the update frequency in hours //! get the update frequency in hours
int getUpdateFrequencyHours(void) {return updateFrequencyHours;} int getUpdateFrequencyHours(void) {return updateFrequencyHours;}
void setUpdateFrequencyHours(int hours) {updateFrequencyHours = hour s;}
//! get the number of seconds till the next update //! get the number of seconds till the next update
int getSecondsToUpdate(void); int getSecondsToUpdate(void);
//! get the update frequency in hours //! get the update frequency in hours
//void setUpdateFrequencyHours(int hours); //void setUpdateFrequencyHours(int hours);
//! Get the current updateState //! Get the current updateState
UpdateState getUpdateState(void) {return updateState;} UpdateState getUpdateState(void) {return updateState;}
//! Get a list of URLs which are sources of TLE data. //! Get a list of URLs which are sources of TLE data.
//! @returns a list of URL strings, some with prefixes - see #update
Urls
//! for details.
QStringList getTleSources(void) {return updateUrls;} QStringList getTleSources(void) {return updateUrls;}
//! Set the list of URLs which are sources of TLE data. //! 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.
//! @see updateUrls
//! @param tleSources a list of valid URLs (http://, ftp://, file://
),
//! allowed prefixes are "0,", "1," or no prefix.
void setTleSources(QStringList tleSources); void setTleSources(QStringList tleSources);
//! Saves the current list of update URLs to the configuration file.
void saveTleSources(const QStringList& urls);
//! Returns the module-specific style sheet. //! Returns the module-specific style sheet.
//! The main StelStyle instance should be passed. //! The main StelStyle instance should be passed.
// TODO: Plugin-specific styles are no longer necessary?
const StelStyle getModuleStyleSheet(const StelStyle& style); const StelStyle getModuleStyleSheet(const StelStyle& style);
//! Reads update file(s) in celestrak's .txt format, and updates //! Reads update file(s) in celestrak's .txt format, and updates
//! the TLE elements for exisiting satellites from them. //! the TLE elements for exisiting satellites from them.
//! emits signals updateStateChanged and tleUpdateComplete //! Indirectly emits signals updateStateChanged() and tleUpdateCompl
ete(),
//! as it calls updateSatellites().
//! See updateFromOnlineSources() for the other kind of update opera
tion.
//! @param paths a list of paths to update files //! @param paths a list of paths to update files
//! @param deleteFiles if set, the update files are deleted after //! @param deleteFiles if set, the update files are deleted after
//! they are used, else they are left alone //! they are used, else they are left alone
void updateFromFiles(QStringList paths, bool deleteFiles=false); void updateFromFiles(QStringList paths, bool deleteFiles=false);
//! Updates the loaded satellite collection from the provided data.
//! Worker function called by updateFromFiles() and saveDownloadedUp
date().
//! (Respecitvely, user-initiated update from file(s) and user- or a
uto-
//! initiated update from online source(s).)
//! Emits updateStateChanged() and tleUpdateComplete().
//! @note Instead of splitting this method off updateFromFiles() and
passing
//! the auto-add flag through data structures, another possiblity wa
s to
//! modify updateFromFiles to use the same prefix trick (adding "1,"
//! to file paths). I decided against it because I thought it would
be more
//! complex. :) --BM
//! @param[in,out] newTleSets a hash with satellite IDs as keys; it'
s
//! modified by the method!
void updateSatellites(TleDataHash& newTleSets);
//! Reads a TLE list from a file to the supplied hash. //! Reads a TLE list from a file to the supplied hash.
//! If an entry with the same ID exists in the given hash, its conte nts //! If an entry with the same ID exists in the given hash, its conte nts
//! are overwritten with the new values. //! are overwritten with the new values.
//! \param openFile a reference to an \b open file. //! \param openFile a reference to an \b open file.
//! \param tleList a hash with satellite IDs (catalog numbers) as ke //! @param[in,out] tleList a hash with satellite IDs as keys.
ys. //! @param[in] addFlagValue value to be set to TleData::addThis for
static void parseTleFile(QFile& openFile, TleDataHash& tleList); all.
//! @todo If this can accept a QIODevice, it will be able to read di
rectly
//! QNetworkReply-s... --BM
static void parseTleFile(QFile& openFile,
TleDataHash& tleList,
bool addFlagValue = false);
bool getFlagHints() {return hintFader;}
//! get the label font size.
//! @return the pixel size of the font
int getLabelFontSize() {return labelFont.pixelSize();}
bool getFlagLabels();
//! Get the current status of the orbit line rendering flag.
bool getOrbitLinesFlag();
bool isAutoAddEnabled() const { return autoAddEnabled; }
bool isAutoRemoveEnabled() const { return autoRemoveEnabled; }
signals: signals:
//! Emitted when some of the plugin settings have been changed.
//! Used to communicate with the configuration window.
void settingsChanged();
//! emitted when the update status changes, e.g. when //! emitted when the update status changes, e.g. when
//! an update starts, completes and so on. Note that //! an update starts, completes and so on. Note that
//! on completion of an update, tleUpdateComplete is also //! on completion of an update, tleUpdateComplete is also
//! emitted with the number of updates done. //! emitted with the number of updates done.
//! @param state the new update state. //! @param state the new update state.
void updateStateChanged(Satellites::UpdateState state); void updateStateChanged(Satellites::UpdateState state);
//! emitted after a TLE update has run. //! Emitted after an update has run.
//! @param updates the number of satellites updated. //! @param updated the number of updated satellites;
//! @param total the total number of satellites in the JSON data. //! @param total the total number of satellites in the catalog;
//! @param the number of satellites in the JSON data but not found i //! @param added the number of newly added satellites;
n update data //! @param missing the number of satellites that were not found in t
void tleUpdateComplete(int updates, int total, int missing); he
//! update source(s) (and were removed, if autoRemoveEnabled is set)
.
void tleUpdateComplete(int updated, int total, int added, int missin
g);
public slots: public slots:
void setFlagHints(bool b) {hintFader=b;} // FIXME: Put back the getter functions - for scripts? --BM
bool getFlagHints(void) {return hintFader;}
//! get the label font size
//! @return the pixel size of the font
int getLabelFontSize(void) {return labelFont.pixelSize();}
//! set the label font size
//! @param size the pixel size of the font
void setLabelFontSize(int size) {labelFont.setPixelSize(size);}
bool getFlagLabels(void); //! Set whether the plugin will try to download updates from the Int
ernet.
//! Emits settingsChanged() if the value changes.
//! @param b if true, updates will be enabled, else they will be dis
abled.
void enableInternetUpdates(bool enabled = true);
//! Emits settingsChanged() if the value changes.
void enableAutoAdd(bool enabled = true);
//! Emits settingsChanged() if the value changes.
void enableAutoRemove(bool enabled = true);
//! Set whether satellite position hints (icons) should be displayed
.
//! Note that hint visibility also applies to satellite labels.
//! Emits settingsChanged() if the value changes.
void setFlagHints(bool b);
//! Set whether text labels should be displayed next to satellite hi
nts.
//! Emits settingsChanged() if the value changes.
//! @todo Decide how to sync with "actionShow_Satellite_Labels".
void setFlagLabels(bool b); void setFlagLabels(bool b);
//! Download TLEs from web recources described in the module section //! set the label font size.
of the //! @param size the pixel size of the font
//! module.ini file and update the TLE values for any satellites for //! Emits settingsChanged() if the value changes.
which void setLabelFontSize(int size);
//! there is new TLE data.
void updateTLEs(void); //! Set the Internet update frequency.
//! Emits settingsChanged() if the value changes.
void setUpdateFrequencyHours(int hours);
//! Start an Internet update.
//! This method starts the process of an Internet update: it tries t
o
//! download TLE lists from online recources and then use them to
//! update the orbital data (and names, etc.) of the included satell
ites.
//! 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 det
ails).
//! If autoAddEnabled is true when this function is called, new sate
llites
//! in the chosen update sources will be added during the update.
//! If autoRemoveEnabled is true when this function is called, any e
xisting
//! satellite that can't be found in the downloaded update lists wil
l be
//! removed.
//! See updateFromFiles() for the other type of update operation.
void updateFromOnlineSources();
//! Choose whether or not to draw orbit lines. Each satellite has i ts own setting //! Choose whether or not to draw orbit lines. Each satellite has i ts own setting
//! as well, but this can be used to turn on/off all those satellite s which elect to //! as well, but this can be used to turn on/off all those satellite s which elect to
//! have orbit lines all in one go. //! have orbit lines all in one go.
//! @param b - true to turn on orbit lines, false to turn off //! @param b - true to turn on orbit lines, false to turn off
void setOrbitLinesFlag(bool b); void setOrbitLinesFlag(bool b);
//! Get the current status of the orbit line rendering flag
bool getOrbitLinesFlag(void);
void recalculateOrbitLines(void); void recalculateOrbitLines(void);
//! Display a message. This is used for plugin-specific warnings and //! Display a message on the screen for a few seconds.
such //! This is used for plugin-specific warnings and such.
void displayMessage(const QString& message, const QString hexColor=" #999999"); void displayMessage(const QString& message, const QString hexColor=" #999999");
void messageTimeout(void); //! Hide all messages.
void hideMessages();
//! Save the current TLE data to the default json file location. //! Save the current satellite catalog to disk.
void saveTleData(QString path=QString()); void saveCatalog(QString path=QString());
private slots: private slots:
void setStelStyle(const QString& section); void setStelStyle(const QString& section);
private: private:
//! if existing, delete Satellites section in main config.ini, then //! Add to the current collection the satellite described by the dat
create with default values a.
void restoreDefaultConfigIni(void); //! @warning Use only in other methods! Does not update satelliteLis
tModel!
//! replace the json file with the default from the compiled-in reso //! @todo This probably could be done easier if Satellite had a cons
urce tructor
void restoreDefaultJsonFile(void); //! accepting TleData... --BM
//! @returns true if the addition was successful.
//! read the json file and create the satellites. Removes existing bool add(const TleData& tleData);
satellites first if there are any
//! Delete Satellites section in main config.ini, then create with d
efault values.
void restoreDefaultSettings();
//! Replace the catalog file with the default one.
void restoreDefaultCatalog();
//! Load the satellites from the catalog file.
//! Removes existing satellites first if there are any.
//! this will be done once at init, and also if the defaults are res et. //! this will be done once at init, and also if the defaults are res et.
void readJsonFile(void); void loadCatalog();
//! Creates a backup of the satellites.json file called satellites.j son.old //! Creates a backup of the satellites.json file called satellites.j son.old
//! @param deleteOriginal if true, the original file is removed, els e not //! @param deleteOriginal if true, the original file is removed, els e not
//! @return true on OK, false on failure //! @return true on OK, false on failure
bool backupJsonFile(bool deleteOriginal=false); bool backupCatalog(bool deleteOriginal=false);
//! Read the version number from the "creator" value in the catalog
//! Get the version from the "creator" value in the satellites.json file.
file
//! @return version string, e.g. "0.6.1" //! @return version string, e.g. "0.6.1"
const QString getJsonFileVersion(void); const QString readCatalogVersion();
bool saveTleMap(const QVariantMap& map, QString path=QString()); //! Save a structure representing a satellite catalog to a JSON file
QVariantMap loadTleMap(QString path=QString()); .
void setTleMap(const QVariantMap& map); //! If no path is specified, catalogPath is used.
//! Generates a QMap that contains all the data on satellites. //! @see createDataMap()
QVariantMap getTleMap(); bool saveDataMap(const QVariantMap& map, QString path=QString());
//! Load a structure representing a satellite catalog from a JSON fi
le.
//! If no path is specified, catalogPath is used.
QVariantMap loadDataMap(QString path=QString());
//! Parse a satellite catalog structure into internal satellite data
.
void setDataMap(const QVariantMap& map);
//! Make a satellite catalog structure from current satellite data.
//! @return a representation of a JSON file.
QVariantMap createDataMap();
//! Sets lastUpdate to the current date/time and saves it to the set
tings.
void markLastUpdate();
//! A fake method for strings marked for translation.
//! Use it instead of translations.h for N_() strings, except perhap
s for
//! keyboard action descriptions. (It's better for them to be in a s
ingle
//! place.)
static void translations();
//! Path to the satellite catalog file.
QString catalogPath;
//! Plug-in data directory.
//! Intialized by init(). Contains the catalog file (satellites.json
),
//! temporary TLE lists downloaded during an online update, or whate
ver
//! other modifiable files the plug-in needs.
QDir dataDir;
QString satellitesJsonPath;
QList<SatelliteP> satellites; QList<SatelliteP> satellites;
SatellitesListModel* satelliteListModel;
//! Union of the groups used by all loaded satellites - see @ref gro
ups.
//! For simplicity, it can only grow until the plug-in is unloaded -
//! a group is not removed even if there are no more satellites tagg
ed with
//! it.
QSet<QString> groups;
LinearFader hintFader; LinearFader hintFader;
class StelTextureNew* hintTexture; class StelTextureNew* hintTexture;
class StelTextureNew* texPointer; class StelTextureNew* texPointer;
//! @name Bottom toolbar button
//@{
QPixmap* pxmapGlow; QPixmap* pxmapGlow;
QPixmap* pxmapOnIcon; QPixmap* pxmapOnIcon;
QPixmap* pxmapOffIcon; QPixmap* pxmapOffIcon;
StelButton* toolbarButton; StelButton* toolbarButton;
//@}
// FIXME: Possible bug with the Solar System recreated by the SSEdit
or.
QSharedPointer<Planet> earth; QSharedPointer<Planet> earth;
Vec3f defaultHintColor; Vec3f defaultHintColor;
Vec3f defaultOrbitColor; Vec3f defaultOrbitColor;
QFont labelFont; QFont labelFont;
// variables and functions for the updater //! @name Updater module
//@{
UpdateState updateState; UpdateState updateState;
QNetworkAccessManager* downloadMgr; QNetworkAccessManager* downloadMgr;
//! List of TLE source lists for automatic updates.
//! Use getTleSources() to get the value, setTleSources() to set it
(and
//! save it to configuration).
//! URLs prefixed with "1," indicate that satellites from this sourc
e will
//! be auto-added if autoAddEnabled is true. URLs prefixed with "0,"
or
//! without a prefix are used only to update existing satellites. Th
is
//! system was introduced to avoid using a custom type as a paramete
r in
//! setTleSources(), which in turn allows it to be used in scripts.
QStringList updateUrls; QStringList updateUrls;
QStringList updateFiles; //! Temporary stores update URLs and files during an online update.
//! In use only between updateFromOnlineSources() and the final call
to
//! saveDownloadedUpdate(). @b DO @b NOT use elsewhere!
//! As a side effect it prevents problems if the user calls
//! setTleSources() while an update is in progress.
TleSourceList updateSources;
QProgressBar* progressBar; QProgressBar* progressBar;
int currentUpdateUrlIdx;
int numberDownloadsComplete; int numberDownloadsComplete;
QTimer* updateTimer; QTimer* updateTimer;
QTimer* messageTimer; //! Flag enabling automatic Internet updates.
QList<int> messageIDs;
bool updatesEnabled; bool updatesEnabled;
//! Flag enabling the automatic addition of new satellites on update
.
//! This will apply only for the selected update sources.
bool autoAddEnabled;
//! Flag enabling the automatic removal of missing satellites on upd
ate.
bool autoRemoveEnabled;
QDateTime lastUpdate; QDateTime lastUpdate;
int updateFrequencyHours; int updateFrequencyHours;
//@}
//! @name Screen message infrastructure
//@{
QTimer* messageTimer;
QList<int> messageIDs;
//@}
// GUI // GUI
SatellitesDialog* configDialog; SatellitesDialog* configDialog;
QByteArray normalStyleSheet; QByteArray normalStyleSheet;
QByteArray nightStyleSheet; QByteArray nightStyleSheet;
private slots: private slots:
//! check to see if an update is required. This is called periodica lly by a timer //! check to see if an update is required. This is called periodica lly by a timer
//! if the last update was longer than updateFrequencyHours ago then the update is //! if the last update was longer than updateFrequencyHours ago then the update is
//! done. //! done.
void checkForUpdate(void); void checkForUpdate(void);
void updateDownloadComplete(QNetworkReply* reply); //! Save the downloaded file and finish the update if it's the last
void observerLocationChanged(StelLocation loc); one.
//! Calls updateSatellites() and indirectly emits updateStateChanged
()
//! and updateFinished().
//! Ends the update process started with updateFromOnlineSources().
//! @todo I've kept the previous behaviour, which was to save the up
date to
//! temporary files and then read them. If we give up on the idea to
//! re-use them later when adding manually satellites, parseTleFile(
)
//! can be modified to read directly form QNetworkReply-s. --BM
void saveDownloadedUpdate(QNetworkReply* reply);
void updateObserverLocation(StelLocation loc);
}; };
#include "fixx11h.h" #include "fixx11h.h"
#include <QObject> #include <QObject>
#include "StelPluginInterface.hpp" #include "StelPluginInterface.hpp"
//! This class is used by Qt to manage a plug-in interface //! This class is used by Qt to manage a plug-in interface
class SatellitesStelPluginInterface : public QObject, public StelPluginInte rface class SatellitesStelPluginInterface : public QObject, public StelPluginInte rface
{ {
 End of changes. 49 change blocks. 
98 lines changed or deleted 373 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/