Satellites.hpp   Satellites.hpp 
/* /*
* Copyright (C) 2009, 2012 Matthew Gates * Copyright (C) 2009, 2012 Matthew Gates
* Copyright (C) 2015 Nick Fedoseev (Iridium flares)
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 45 skipping to change at line 46
class StelButton; class StelButton;
class Planet; class Planet;
class QNetworkAccessManager; class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class QSettings; class QSettings;
class QTimer; class QTimer;
class SatellitesDialog; class SatellitesDialog;
class SatellitesListModel; class SatellitesListModel;
/*! @defgroup satellites Satellites Plug-in
@{
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).
<b>Satellite Properties</b>
<i>Name and identifiers</i>
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 <b>Satellite Catalog</b> satellites are uniquely identified by their
NORAD number, which is encoded in TLEs.
<i>Grouping</i>
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 <b>Satellite Catalog</b> f
or each satellite and are more similar to the concept of "tags" than a hier
archical grouping. 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.
<b>Satellite Catalog</b>
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.
<b>Configuration</b>
The plug-ins' configuration data is stored in Stellarium's main configurati
on
file.
@}
*/
//! 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.
//! @ingroup satellites
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. //! Flag indicating whether this satellite should be added.
//! See Satellites::autoAddEnabled. //! See Satellites::autoAddEnabled.
bool addThis; bool addThis;
}; };
//! @ingroup satellites
typedef QList<TleData> TleDataList; typedef QList<TleData> TleDataList;
//! @ingroup satellites
typedef QHash<QString, TleData> TleDataHash ; typedef QHash<QString, TleData> TleDataHash ;
//! TLE update source, used only internally for now. //! TLE update source, used only internally for now.
//! @ingroup satellites
struct TleSource struct TleSource
{ {
//! URL from where the source list should be downloaded. //! URL from where the source list should be downloaded.
QUrl url; QUrl url;
//! The downloaded file, location set after finishing download. //! The downloaded file, location set after finishing download.
//! In the future may be a QTemporaryFile object. //! In the future may be a QTemporaryFile object.
QFile* file; QFile* file;
//! Flag indicating whether new satellites in this list should be ad ded. //! Flag indicating whether new satellites in this list should be ad ded.
//! See Satellites::autoAddEnabled. //! See Satellites::autoAddEnabled.
bool addNew; bool addNew;
}; };
//! @ingroup satellites
typedef QList<TleSource> TleSourceList; typedef QList<TleSource> TleSourceList;
/*! @mainpage notitle struct IridiumFlaresPrediction
@section overview Plugin Overview {
QString datetime;
The %Satellites plugin displays the positions of artifical satellites in Ea QString satellite;
rth float azimuth; // radians
orbit based on a catalog of orbital data. float altitude; // radians
float magnitude;
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 typedef QList<IridiumFlaresPrediction> IridiumFlaresPredictionList;
The plug-ins' configuration data is stored in Stellarium's main configurati
on
file.
*/
//! @class Satellites //! @class Satellites
//! Main class of the %Satellites plugin. //! Main class of the %Satellites plugin.
//! @author Matthew Gates //! @author Matthew Gates
//! @author Bogdan Marinov //! @author Bogdan Marinov
//! @ingroup satellites
class Satellites : public StelObjectModule class Satellites : public StelObjectModule
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool hintsVisible Q_PROPERTY(bool hintsVisible
READ getFlagHints READ getFlagHints
WRITE setFlagHints) WRITE setFlagHints)
Q_PROPERTY(bool labelsVisible Q_PROPERTY(bool labelsVisible
READ getFlagLabels READ getFlagLabels
WRITE setFlagLabels) WRITE setFlagLabels)
Q_PROPERTY(bool autoAddEnabled Q_PROPERTY(bool autoAddEnabled
skipping to change at line 354 skipping to change at line 377
//! 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() {return labelFont.pixelSize();} int getLabelFontSize() {return labelFont.pixelSize();}
bool getFlagLabels(); bool getFlagLabels();
bool getFlagRealisticMode(); bool getFlagRealisticMode();
//! Get the current status of the orbit line rendering flag. //! Get the current status of the orbit line rendering flag.
bool getOrbitLinesFlag(); bool getOrbitLinesFlag();
bool isAutoAddEnabled() const { return autoAddEnabled; } bool isAutoAddEnabled() const { return autoAddEnabled; }
bool isAutoRemoveEnabled() const { return autoRemoveEnabled; } bool isAutoRemoveEnabled() const { return autoRemoveEnabled; }
IridiumFlaresPredictionList getIridiumFlaresPrediction();
signals: signals:
//! Emitted when some of the plugin settings have been changed. //! Emitted when some of the plugin settings have been changed.
//! Used to communicate with the configuration window. //! Used to communicate with the configuration window.
void settingsChanged(); 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.
skipping to change at line 590 skipping to change at line 615
//! Save the downloaded file and finish the update if it's the last one. //! Save the downloaded file and finish the update if it's the last one.
//! Calls updateSatellites() and indirectly emits updateStateChanged () //! Calls updateSatellites() and indirectly emits updateStateChanged ()
//! and updateFinished(). //! and updateFinished().
//! Ends the update process started with updateFromOnlineSources(). //! Ends the update process started with updateFromOnlineSources().
//! @todo I've kept the previous behaviour, which was to save the up date to //! @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 //! temporary files and then read them. If we give up on the idea to
//! re-use them later when adding manually satellites, parseTleFile( ) //! re-use them later when adding manually satellites, parseTleFile( )
//! can be modified to read directly form QNetworkReply-s. --BM //! can be modified to read directly form QNetworkReply-s. --BM
void saveDownloadedUpdate(QNetworkReply* reply); void saveDownloadedUpdate(QNetworkReply* reply);
void updateObserverLocation(StelLocation loc); void updateObserverLocation(StelLocation loc);
}; };
#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
{ {
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 75 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/