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 <QSharedPointer> #include <QSharedPointer>
#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; class SatellitesDialog;
typedef QSharedPointer<Satellite> SatelliteP; typedef QSharedPointer<Satellite> SatelliteP;
//! @class Satellites //! @class Satellites
//! Satellites in low Earth orbith require different orbital calculations f rom planets, the moon //! Satellites in low Earth orbit require different orbital calculations fr om planets, the moon
//! and so on. This plugin implements the SGP4/SDP4 algorithms in Stellari um, allowing accurate //! and so on. This plugin implements the SGP4/SDP4 algorithms in Stellari um, allowing accurate
//! prediction of the position of artificial satellites. //! prediction of the position of artificial satellites.
class Satellites : public StelObjectModule class Satellites : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
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
{ {
skipping to change at line 119 skipping to change at line 120
//! 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 be called from init and also //! Read (or re-read) settings from the main config file. This will be called from init and also
//! when restoring defaults (i.e. from the configuration dialog / re store defaults button). //! when restoring defaults (i.e. from the configuration dialog / re store defaults button).
void readSettingsFromConfig(void); void readSettingsFromConfig(void);
//! Save the settings to the main configuration file.
void saveSettingsToConfig(void);
//! Get a list of satellite group names. A Satellite may be long to one or more group //! Get a list of satellite group names. A Satellite may be long to one or more group
//! e.g. "amateur" and "navigation". Group names are arbitrary stri ngs defined in the //! e.g. "amateur" and "navigation". Group names are arbitrary stri ngs defined in the
//! json file. Think of them like tags. A satellite may not belong to any group at all. //! json file. Think of them like tags. A satellite may not belong to any group at all.
QStringList getGroups(void) const; QStringList getGroups(void) const;
//! 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
QStringList getSatellites(const QString& group=QString(), Visibility vis=Both); QStringList getSatellites(const QString& group=QString(), Visibility vis=Both);
//! get a satellite object by identifier //! get a satellite object by identifier
skipping to change at line 164 skipping to change at line 168
//! Get a list of URLs which are sources of TLE data. //! Get a list of URLs which are sources of TLE data.
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.
void setTleSources(QStringList tleSources); void setTleSources(QStringList tleSources);
//! 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.
const StelStyle getModuleStyleSheet(const StelStyle& style); const StelStyle getModuleStyleSheet(const StelStyle& style);
//! Reads update file(s) in celestrak's .txt format, and updates
//! the TLE elements for exisiting satellites from them.
//! emits signals updateStateChanged and tleUpdateComplete
//! @param paths a list of paths to update files
//! @param deleteFiles if set, the update files are deleted after
//! they are used, else they are left alone
void updateFromFiles(QStringList paths, bool deleteFiles=false);
signals: signals:
//! 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 a TLE update has run.
//! @param updates the number of satellites updated. //! @param updates the number of satellites updated.
void TleUpdateComplete(int updates); //! @param total the total number of satellites in the JSON data.
//! @param the number of satellites in the JSON data but not found i
n update data
void tleUpdateComplete(int updates, int total, int missing);
public slots: public slots:
void setFlagHints(bool b) {hintFader=b;} void setFlagHints(bool b) {hintFader=b;}
bool getFlagHints(void) {return hintFader;} bool getFlagHints(void) {return hintFader;}
//! get the label font size //! get the label font size
//! @return the pixel size of the font //! @return the pixel size of the font
int getLabelFontSize(void) {return labelFont.pixelSize();} int getLabelFontSize(void) {return labelFont.pixelSize();}
//! set the label font size //! set the label font size
//! @param size the pixel size of the font //! @param size the pixel size of the font
void setLabelFontSize(int size) {labelFont.setPixelSize(size);} void setLabelFontSize(int size) {labelFont.setPixelSize(size);}
bool getFlagLabels(void); bool getFlagLabels(void);
void setFlagLabels(bool b); void setFlagLabels(bool b);
//! Download TLEs from web recources described in the module section of the //! Download TLEs from web recources described in the module section of the
//! module.ini file and update the TLE values for any satellites for which //! module.ini file and update the TLE values for any satellites for which
//! there is new TLE data. //! there is new TLE data.
void updateTLEs(void); void updateTLEs(void);
//! 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
//! have orbit lines all in one go.
//! @param b - true to turn on orbit lines, false to turn off
void setOrbitLinesFlag(bool b);
//! Get the current status of the orbit line rendering flag
bool getOrbitLinesFlag(void);
void recalculateOrbitLines(void);
//! Display a message. This is used for plugin-specific warnings and
such
void displayMessage(const QString& message, const QString hexColor="
#999999");
void messageTimeout(void);
//! Save the current TLE data to the default json file location.
void saveTleData(QString path=QString());
private: private:
// if existing, delete Satellites section in main config.ini, then c reate with default values // if existing, delete Satellites section in main config.ini, then c reate with default values
void restoreDefaultConfigIni(void); void restoreDefaultConfigIni(void);
// replace the json file with the default from the compiled-in resou rce // replace the json file with the default from the compiled-in resou rce
void restoreDefaultJsonFile(void); void restoreDefaultJsonFile(void);
// read the json file and create the satellites. Removes existing s atellites first if there are any // read the json file and create the satellites. Removes existing s atellites first if there are any
// this will be done once at init, and also if the defaults are rese t. // this will be done once at init, and also if the defaults are rese t.
// @return the number of satellites read from the json file void readJsonFile(void);
int readJsonFile(void);
//! 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
//! @return true on OK, false on failure
bool backupJsonFile(bool deleteOriginal=false);
//! Get the version from the "creator" value in the satellites.json
file
//! @return version string, e.g. "0.6.1"
const QString getJsonFileVersion(void);
bool saveTleMap(const QVariantMap& map, QString path=QString());
QVariantMap loadTleMap(QString path=QString());
void setTleMap(const QVariantMap& map);
QVariantMap getTleMap(void);
QString satellitesJsonPath; QString satellitesJsonPath;
QList<SatelliteP> satellites; QList<SatelliteP> satellites;
LinearFader hintFader; LinearFader hintFader;
StelTextureSP texPointer; StelTextureSP texPointer;
QPixmap* pxmapGlow; QPixmap* pxmapGlow;
QPixmap* pxmapOnIcon; QPixmap* pxmapOnIcon;
QPixmap* pxmapOffIcon; QPixmap* pxmapOffIcon;
StelButton* toolbarButton; StelButton* toolbarButton;
QSharedPointer<Planet> earth; QSharedPointer<Planet> earth;
Vec3f defaultHintColor; Vec3f defaultHintColor;
Vec3f defaultOrbitColor;
QFont labelFont; QFont labelFont;
// variables and functions for the updater // variables and functions for the updater
UpdateState updateState; UpdateState updateState;
QNetworkAccessManager* downloadMgr; QNetworkAccessManager* downloadMgr;
QStringList updateUrls; QStringList updateUrls;
QStringList updateFiles; QStringList updateFiles;
QProgressBar* progressBar; QProgressBar* progressBar;
int currentUpdateUrlIdx; int currentUpdateUrlIdx;
int numberDownloadsComplete; int numberDownloadsComplete;
QTimer* updateTimer; QTimer* updateTimer;
QTimer* messageTimer;
QList<int> messageIDs;
bool updatesEnabled; bool updatesEnabled;
QDateTime lastUpdate; QDateTime lastUpdate;
int updateFrequencyHours; int updateFrequencyHours;
void updateFromFiles(void);
// 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.
 End of changes. 11 change blocks. 
6 lines changed or deleted 61 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/