Pulsars.hpp   Pulsars.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 _PULSARS_HPP_ #ifndef _PULSARS_HPP_
#define _PULSARS_HPP_ #define _PULSARS_HPP_
#include "StelObjectModule.hpp" #include "StelObjectModule.hpp"
#include "StelObject.hpp" #include "StelObject.hpp"
#include "StelFader.hpp" #include "StelFader.hpp"
#include "StelTextureTypes.hpp"
#include "Pulsar.hpp" #include "Pulsar.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 QPixmap; class QPixmap;
class StelButton; class StelButton;
class PulsarsDialog; class PulsarsDialog;
class StelPainter;
typedef QSharedPointer<Pulsar> PulsarP; typedef QSharedPointer<Pulsar> PulsarP;
//! 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 Pulsars : public StelObjectModule class Pulsars : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool pulsarsVisible READ getFlagShowPulsars WRITE setFlag ShowPulsars)
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
}; };
Pulsars(); Pulsars();
virtual ~Pulsars(); virtual ~Pulsars();
//////////////////////////////////////////////////////////////////// /////// //////////////////////////////////////////////////////////////////// ///////
// 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) {;} virtual void update(double) {;}
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 satellites. //! @param limitFov the field of view around the position v in which to search for satellites.
//! @param core the StelCore to use for computations. //! @param core the StelCore to use for computations.
//! @return an list containing the satellites located inside the lim itFov circle around position v. //! @return an list containing the satellites 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 128 skipping to change at line 131
//! Save the settings to the main configuration file. //! Save the settings to the main configuration file.
void saveSettingsToConfig(void); void saveSettingsToConfig(void);
//! get whether or not the plugin will try to update catalog data fr om the internet //! get whether or not the plugin will try to update catalog data fr om the 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 catalog data fr om the internet //! set whether or not the plugin will try to update catalog data fr om the 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 getGlitchFlag(void);
void setGlitchFlag(bool b);
QString getMarkerColor(bool mtype = true);
void setMarkerColor(QString c, bool mtype = true);
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 pulsars were updated
QDateTime getLastUpdate(void) {return lastUpdate;} QDateTime getLastUpdate(void) {return lastUpdate;}
//! get the update frequency in days //! get the update frequency in days
int getUpdateFrequencyDays(void) {return updateFrequencyDays;} int getUpdateFrequencyDays(void) {return updateFrequencyDays;}
void setUpdateFrequencyDays(int days) {updateFrequencyDays = days;} void setUpdateFrequencyDays(int days) {updateFrequencyDays = days;}
//! 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 pulsars from catalog
int getCountPulsars(void) {return PsrCount;}
signals: signals:
//! @param state the new update state. //! @param state the new update state.
void updateStateChanged(Pulsars::UpdateState state); void updateStateChanged(Pulsars::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 207 skipping to change at line 219
bool checkJsonFileFormat(void); bool checkJsonFileFormat(void);
//! parse JSON file and load pulsars to map //! parse JSON file and load pulsars to map
QVariantMap loadPSRMap(QString path=QString()); QVariantMap loadPSRMap(QString path=QString());
//! set items for list of struct from data map //! set items for list of struct from data map
void setPSRMap(const QVariantMap& map); void setPSRMap(const QVariantMap& map);
QString jsonCatalogPath; QString jsonCatalogPath;
class StelTextureNew* texPointer; StelTextureSP texPointer;
class StelTextureNew* markerTexture;
QList<PulsarP> psr; QList<PulsarP> psr;
int PsrCount;
// 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 updateFrequencyDays; int updateFrequencyDays;
bool distributionEnabled;
bool enableAtStartup; bool enableAtStartup;
QSettings* conf; QSettings* conf;
// GUI // GUI
PulsarsDialog* configDialog; PulsarsDialog* configDialog;
bool flagShowPulsars; bool flagShowPulsars;
bool flagShowPulsarsButton; bool flagShowPulsarsButton;
QPixmap* OnIcon; QPixmap* OnIcon;
QPixmap* OffIcon; QPixmap* OffIcon;
QPixmap* GlowIcon; 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 PulsarsStelPluginInterface : public QObject, public StelPluginInterfa ce class PulsarsStelPluginInterface : public QObject, public StelPluginInterfa ce
{ {
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 /*_PULSARS_HPP_*/ #endif /*_PULSARS_HPP_*/
 End of changes. 14 change blocks. 
12 lines changed or deleted 23 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/