Exoplanets.hpp   Exoplanets.hpp 
skipping to change at line 73 skipping to change at line 73
//! @ingroup exoplanets //! @ingroup exoplanets
typedef QSharedPointer<Exoplanet> ExoplanetP; typedef QSharedPointer<Exoplanet> ExoplanetP;
//! @class Exoplanets //! @class Exoplanets
//! Main class of the %Exoplanets plugin. //! Main class of the %Exoplanets plugin.
//! @author Alexander Wolf //! @author Alexander Wolf
//! @ingroup exoplanets //! @ingroup exoplanets
class Exoplanets : public StelObjectModule class Exoplanets : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool showExoplanets READ getFlagShowExoplanets WRITE setF Q_PROPERTY(bool showExoplanets
lagShowExoplanets) READ getFlagShowExoplanets
WRITE setFlagShowExoplanets
NOTIFY flagExoplanetsVisibilityChanged
)
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
}; };
skipping to change at line 114 skipping to change at line 118
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;
//! Return the matching satellite object's pointer if exists or NULL . //! Return the matching satellite object's pointer if exists or NULL .
//! @param nameI18n The case in-sensistive satellite name //! @param nameI18n The case in-sensistive satellite name
virtual StelObjectP searchByNameI18n(const QString& nameI18n) const; virtual StelObjectP searchByNameI18n(const QString& nameI18n) const;
//! Return the matching satellite if exists or NULL. //! Return the matching satellite if exists or NULL.
//! @param name The case in-sensistive standard program name //! @param name The case in-sensistive standard program name
virtual StelObjectP searchByName(const QString& name) const; virtual StelObjectP searchByName(const QString& name) const;
//! Find and return the list of at most maxNbItem objects auto-compl eting the passed object I18n name. //! Find and return the list of at most maxNbItem objects auto-compl eting the passed object name.
//! @param objPrefix the case insensitive first letters of the searc hed object //! @param objPrefix the case insensitive first letters of the searc hed object
//! @param maxNbItem the maximum number of returned object names //! @param maxNbItem the maximum number of returned object names
//! @param useStartOfWords the autofill mode for returned objects na mes //! @param useStartOfWords the autofill mode for returned objects na mes
//! @return a list of matching object name by order of relevance, or an empty list if nothing match //! @return a list of matching object name by order of relevance, or an empty list if nothing match
virtual QStringList listMatchingObjectsI18n(const QString& objPrefix virtual QStringList listMatchingObjects(const QString& objPrefix, in
, int maxNbItem=5, bool useStartOfWords=false) const; t maxNbItem=5, bool useStartOfWords=false, bool inEnglish=true) const;
//! Find and return the list of at most maxNbItem objects auto-compl
eting the passed object English name.
//! @param objPrefix the case insensitive first letters of the searc
hed object
//! @param maxNbItem the maximum number of returned object names
//! @param useStartOfWords the autofill mode for returned objects na
mes
//! @return a list of matching object name by order of relevance, or
an empty list if nothing match
virtual QStringList listMatchingObjects(const QString& objPrefix, in
t maxNbItem=5, bool useStartOfWords=false) const;
virtual QStringList listAllObjects(bool inEnglish) const; virtual QStringList listAllObjects(bool inEnglish) const;
virtual QStringList listAllObjectsByType(const QString& objType, boo l inEnglish) const { Q_UNUSED(objType) Q_UNUSED(inEnglish) return QStringLi st(); }
virtual QString getName() const { return "Exoplanets"; } virtual QString getName() const { return "Exoplanets"; }
//! get a exoplanet object by identifier //! get a exoplanet object by identifier
ExoplanetP getByID(const QString& id); ExoplanetP getByID(const QString& id);
//! Implement this to tell the main Stellarium GUI that there is a G UI element to configure this //! Implement this to tell the main Stellarium GUI that there is a G UI element to configure this
//! plugin. //! plugin.
virtual bool configureGui(bool show=true); virtual bool configureGui(bool show=true);
skipping to change at line 159 skipping to change at line 155
//! Save the settings to the main configuration file. //! Save the settings to the main configuration file.
void saveConfiguration(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);
void setDisplayMode(bool b);
bool getTimelineMode(void);
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 QList<double> getExoplanetsData(int mode)
int getCountPlanetarySystems(void) const
{ {
return PSCount; switch(mode)
} {
case 1:
//! Get count of exoplanets from catalog return EPSemiAxisAll;
int getCountAllExoplanets(void) const break;
{ case 2:
return EPCountAll; return EPMassAll;
} break;
case 3:
//! Get count of potentially habitable exoplanets from catalog return EPRadiusAll;
int getCountHabitableExoplanets(void) const break;
{ case 4:
return EPCountPH; return EPPeriodAll;
break;
case 5:
return EPAngleDistanceAll;
break;
default:
return EPEccentricityAll;
}
} }
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);
void flagExoplanetsVisibilityChanged(bool b);
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.
void updateJSON(void); void updateJSON(void);
void setFlagShowExoplanets(bool b) { flagShowExoplanets=b; } //! Enable/disable display of markers of exoplanetary systems
//! @param b boolean flag
void setFlagShowExoplanets(bool b);
//! Get status to display of markers of exoplanetary systems
//! @return true if it's visible
bool getFlagShowExoplanets(void) { return flagShowExoplanets; } bool getFlagShowExoplanets(void) { return flagShowExoplanets; }
//! Define whether the button toggling exoplanets should be visible //! Define whether the button toggling exoplanets should be visible
void setFlagShowExoplanetsButton(bool b); void setFlagShowExoplanetsButton(bool b);
bool getFlagShowExoplanetsButton(void) { return flagShowExoplanetsBu tton; } bool getFlagShowExoplanetsButton(void) { return flagShowExoplanetsBu tton; }
//! Display a message. This is used for plugin-specific warnings and //! Get status to display of distribution of exoplanetary systems
such //! @return true if distribution of exoplanetary systems is enabled
void displayMessage(const QString& message, const QString hexColor=" bool getDisplayMode(void);
#999999"); //! Enable/disable display of distribution of exoplanetary systems
void messageTimeout(void); //! @param b
void setDisplayMode(bool b);
//! Get status to display of systems with exoplanets after their dis
covery
//! @return true if markers of exoplanetary systems are visible afte
r discovery of exoplanets
bool getTimelineMode(void);
//! Enable/disable display of systems with exoplanets after their di
scovery only
//! @param b
void setTimelineMode(bool b);
//! Get status to display of exoplanetary systems with the potential
ly habitable exoplanets
//! @return true if systems with only potentially habitable exoplane
ts are visible
bool getHabitableMode(void);
//! Enable/disable display of exoplanetary systems with the potentia
lly habitable exoplanets only
//! @param b
void setHabitableMode(bool b);
//! Get color for markers of exoplanetary systems
//! @param h set false if you want get color of markers of potential
ly habitable exoplanets
//! @return color
Vec3f getMarkerColor(bool habitable);
//! Set color for markers of exoplanetary systems
//! @param c color
//! @param h set true if you want set color for potentially habitabl
e exoplanets
//! @code
//! // example of usage in scripts
//! Exoplanets.setMarkerColor(Vec3f(1.0,0.0,0.0), true);
//! @endcode
void setMarkerColor(const Vec3f& c, bool h);
//! Get count of planetary systems from catalog
//! @return count of planetary systems
int getCountPlanetarySystems(void) const
{
return PSCount;
}
//! Get count of exoplanets from catalog
//! @return count of all exoplanets
int getCountAllExoplanets(void) const
{
return EPCountAll;
}
//! Get count of potentially habitable exoplanets from catalog
//! @return count of potentially habitable exoplanets
int getCountHabitableExoplanets(void) const
{
return EPCountPH;
}
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 resetConfiguration(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);
skipping to change at line 275 skipping to change at line 322
//! keyboard action descriptions. (It's better for them to be in a s ingle //! keyboard action descriptions. (It's better for them to be in a s ingle
//! place.) //! place.)
static void translations(); static void translations();
QString jsonCatalogPath; QString jsonCatalogPath;
int PSCount; int PSCount;
int EPCountAll; int EPCountAll;
int EPCountPH; int EPCountPH;
QList<double> EPEccentricityAll, EPSemiAxisAll, EPMassAll, EPRadiusA
ll, EPPeriodAll, EPAngleDistanceAll;
StelTextureSP texPointer; 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;
skipping to change at line 306 skipping to change at line 355
StelButton* toolbarButton; StelButton* toolbarButton;
class StelProgressController* 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);
//! Display a message. This is used for plugin-specific warnings and
such
void displayMessage(const QString& message, const QString hexColor="
#999999");
void messageTimeout(void);
void reloadCatalog(void);
}; };
#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 StelPluginInterface_iid) Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
 End of changes. 12 change blocks. 
51 lines changed or deleted 108 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/