Exoplanets.hpp   Exoplanets.hpp 
skipping to change at line 25 skipping to change at line 25
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _EXOPLANETS_HPP_ #ifndef _EXOPLANETS_HPP_
#define _EXOPLANETS_HPP_ #define _EXOPLANETS_HPP_
#include "StelObjectModule.hpp" #include "StelObjectModule.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelFader.hpp" #include "StelFader.hpp"
#include "StelTextureTypes.hpp"
#include "Exoplanet.hpp" #include "Exoplanet.hpp"
#include <QFont> #include <QFont>
#include <QVariantMap> #include <QVariantMap>
#include <QDateTime> #include <QDateTime>
#include <QList> #include <QList>
#include <QSharedPointer> #include <QSharedPointer>
class QNetworkAccessManager; class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class QProgressBar;
class QSettings; class QSettings;
class QTimer; class QTimer;
class ExoplanetsDialog; class ExoplanetsDialog;
class QPixmap; class StelPainter;
class StelButton; class StelButton;
typedef QSharedPointer<Exoplanet> ExoplanetP; typedef QSharedPointer<Exoplanet> ExoplanetP;
//! This is an example of a plug-in which can be dynamically loaded into st ellarium //! This is an example of a plug-in which can be dynamically loaded into st ellarium
class Exoplanets : public StelObjectModule class Exoplanets : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool showExoplanets READ getFlagShowExoplanets WRITE setF lagShowExoplanets)
public: public:
//! @enum UpdateState //! @enum UpdateState
//! Used for keeping for track of the download/update status //! Used for keeping for track of the download/update status
enum UpdateState { enum UpdateState {
Updating, //!< Update in progress Updating, //!< Update in progress
CompleteNoUpdates, //!< Update completed, there we no u pdates CompleteNoUpdates, //!< Update completed, there we no u pdates
CompleteUpdates, //!< Update completed, there were up dates CompleteUpdates, //!< Update completed, there were up dates
DownloadError, //!< Error during download phase DownloadError, //!< Error during download phase
OtherError //!< Other error OtherError //!< Other error
}; };
Exoplanets(); Exoplanets();
virtual ~Exoplanets(); virtual ~Exoplanets();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in the StelModule class // Methods defined in the StelModule class
virtual void init(); virtual void init();
virtual void deinit(); virtual void deinit();
virtual void update(double deltaTime); virtual void update(double deltaTime);
virtual void draw(StelCore* core, class StelRenderer* renderer); virtual void draw(StelCore* core);
virtual void drawPointer(StelCore* core, class StelRenderer* rendere virtual void drawPointer(StelCore* core, StelPainter& painter);
r,
StelProjectorP projector);
virtual double getCallOrder(StelModuleActionName actionName) const; virtual double getCallOrder(StelModuleActionName actionName) const;
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// Methods defined in StelObjectManager class // Methods defined in StelObjectManager class
//! Used to get a list of objects which are near to some position. //! Used to get a list of objects which are near to some position.
//! @param v a vector representing the position in th sky around whi ch to search for nebulae. //! @param v a vector representing the position in th sky around whi ch to search for nebulae.
//! @param limitFov the field of view around the position v in which to search for exoplanets. //! @param limitFov the field of view around the position v in which to search for exoplanets.
//! @param core the StelCore to use for computations. //! @param core the StelCore to use for computations.
//! @return an list containing the exoplanets located inside the lim itFov circle around position v. //! @return an list containing the exoplanets located inside the lim itFov circle around position v.
virtual QList<StelObjectP> searchAround(const Vec3d& v, double limit Fov, const StelCore* core) const; virtual QList<StelObjectP> searchAround(const Vec3d& v, double limit Fov, const StelCore* core) const;
skipping to change at line 120 skipping to change at line 120
//! 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 Exoplanets section in the //! Set up the plugin with default values. This means clearing out the Exoplanets 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 exoplanets.json file from the resource embed ded in the plugin lib/dll file. //! creates the default exoplanets.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 loadConfiguration(void);
//! Save the settings to the main configuration file. //! Save the settings to the main configuration file.
void saveSettingsToConfig(void); void saveConfiguration(void);
//! 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 //! 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 //! @param b if true, updates will be enabled, else they will be dis abled
void setUpdatesEnabled(bool b) {updatesEnabled=b;} void setUpdatesEnabled(bool b) {updatesEnabled=b;}
bool getDisplayMode(void) {return distributionEnabled;} bool getDisplayMode(void);
void setDisplayMode(bool b) {distributionEnabled=b;} void setDisplayMode(bool b);
bool getTimelineMode(void) {return timelineEnabled;} bool getTimelineMode(void);
void setTimelineMode(bool b) {timelineEnabled=b;} void setTimelineMode(bool b);
bool getHabitableMode(void);
void setHabitableMode(bool b);
QString getMarkerColor(bool habitable);
void setMarkerColor(QString c, bool h);
void setEnableAtStartup(bool b) { enableAtStartup=b; } void setEnableAtStartup(bool b) { enableAtStartup=b; }
bool getEnableAtStartup(void) { return enableAtStartup; } bool getEnableAtStartup(void) { return enableAtStartup; }
//! 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;} 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 current updateState //! Get the current updateState
UpdateState getUpdateState(void) {return updateState;} UpdateState getUpdateState(void) {return updateState;}
//! Get count of planetary systems from catalog
int getCountPlanetarySystems(void) const
{
return PSCount;
}
//! Get count of exoplanets from catalog
int getCountAllExoplanets(void) const
{
return EPCountAll;
}
//! Get count of potentially habitable exoplanets from catalog
int getCountHabitableExoplanets(void) const
{
return EPCountPH;
}
signals: signals:
//! @param state the new update state. //! @param state the new update state.
void updateStateChanged(Exoplanets::UpdateState state); void updateStateChanged(Exoplanets::UpdateState state);
//! emitted after a JSON update has run. //! emitted after a JSON update has run.
void jsonUpdateComplete(void); void jsonUpdateComplete(void);
public slots: public slots:
//! Download JSON from web recources described in the module section of the //! Download JSON from web recources described in the module section of the
//! module.ini file and update the local JSON file. //! module.ini file and update the local JSON file.
skipping to change at line 182 skipping to change at line 206
//! Display a message. This is used for plugin-specific warnings and such //! Display a message. 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); void messageTimeout(void);
private: private:
// Font used for displaying our text // Font used for displaying our text
QFont font; QFont font;
// 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 resetConfiguration(void);
// Upgrade config.ini: rename old key settings to new // Upgrade config.ini: rename old key settings to new
void upgradeConfigIni(void); void upgradeConfigIni(void);
//! replace the json file with the default from the compiled-in reso urce //! replace the json file with the default from the compiled-in reso urce
void restoreDefaultJsonFile(void); void restoreDefaultJsonFile(void);
//! read the json file and create list of exoplanets. //! read the json file and create list of exoplanets.
void readJsonFile(void); void readJsonFile(void);
skipping to change at line 214 skipping to change at line 238
bool checkJsonFileFormat(void); bool checkJsonFileFormat(void);
//! parse JSON file and load exoplanets to map //! parse JSON file and load exoplanets to map
QVariantMap loadEPMap(QString path=QString()); QVariantMap loadEPMap(QString path=QString());
//! set items for list of struct from data map //! set items for list of struct from data map
void setEPMap(const QVariantMap& map); void setEPMap(const QVariantMap& map);
QString jsonCatalogPath; QString jsonCatalogPath;
StelTextureNew* texPointer; int PSCount;
StelTextureNew* markerTexture; int EPCountAll;
int EPCountPH;
StelTextureSP texPointer;
QList<ExoplanetP> ep; QList<ExoplanetP> ep;
// variables and functions for the updater // variables and functions for the updater
UpdateState updateState; UpdateState updateState;
QNetworkAccessManager* downloadMgr; QNetworkAccessManager* downloadMgr;
QString updateUrl; QString updateUrl;
QTimer* updateTimer; QTimer* updateTimer;
QTimer* messageTimer; QTimer* messageTimer;
QList<int> messageIDs; QList<int> messageIDs;
bool updatesEnabled; bool updatesEnabled;
QDateTime lastUpdate; QDateTime lastUpdate;
int updateFrequencyHours; int updateFrequencyHours;
bool distributionEnabled;
bool timelineEnabled;
bool enableAtStartup; bool enableAtStartup;
QSettings* conf; QSettings* conf;
// GUI // GUI
ExoplanetsDialog* exoplanetsConfigDialog; ExoplanetsDialog* exoplanetsConfigDialog;
bool flagShowExoplanets; bool flagShowExoplanets;
bool flagShowExoplanetsButton; bool flagShowExoplanetsButton;
QPixmap* OnIcon;
QPixmap* OffIcon;
QPixmap* GlowIcon;
StelButton* toolbarButton; StelButton* toolbarButton;
QProgressBar* progressBar; class StelProgressController* progressBar;
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); void updateDownloadComplete(QNetworkReply* reply);
}; };
#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 ExoplanetsStelPluginInterface : public QObject, public StelPluginInte rface class ExoplanetsStelPluginInterface : public QObject, public StelPluginInte rface
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "stellarium.StelGuiPluginInterface/1.0")
Q_INTERFACES(StelPluginInterface) Q_INTERFACES(StelPluginInterface)
public: public:
virtual StelModule* getStelModule() const; virtual StelModule* getStelModule() const;
virtual StelPluginInfo getPluginInfo() const; virtual StelPluginInfo getPluginInfo() const;
}; };
#endif /*_EXOPLANETS_HPP_*/ #endif /*_EXOPLANETS_HPP_*/
 End of changes. 17 change blocks. 
22 lines changed or deleted 43 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/