Satellite.hpp   Satellite.hpp 
/* /*
* Stellarium * Stellarium
* Copyright (C) 2009 Matthew Gates * Copyright (C) 2009, 2012 Matthew Gates
* *
* 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.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _SATELLITE_HPP_ #ifndef _SATELLITE_HPP_
#define _SATELLITE_HPP_ 1 #define _SATELLITE_HPP_ 1
#include <QVariant> #include <QVariant>
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QFont> #include <QFont>
#include <QList> #include <QList>
skipping to change at line 56 skipping to change at line 56
//! @class Satellite //! @class Satellite
//! A Satellite object represents one satellite in Earth orbit. //! A Satellite object represents one satellite in Earth orbit.
//! Details about the satellite are passed using a QVariant which contains //! Details about the satellite are passed using a QVariant which contains
//! a map of data from the json file. //! a map of data from the json file.
class Satellite : public StelObject class Satellite : public StelObject
{ {
friend class Satellites; friend class Satellites;
friend class SatellitesDialog; friend class SatellitesDialog;
public: public:
//! @param id The official designation for a satellite, e.g. "ZARYA" //! \param identifier unique identifier (currently the Catalog Numbe
//! @param conf a pointer to a QSettings object which contains the r)
//! details of the satellite (TLEs, description etc.) //! \param data a QMap which contains the details of the satellite
Satellite(const QVariantMap& map); //! (TLE set, description etc.)
Satellite(const QString& identifier, const QVariantMap& data);
~Satellite(); ~Satellite();
//! Get a QVariantMap which describes the satellite. Could be used to //! Get a QVariantMap which describes the satellite. Could be used to
//! create a duplicate. //! create a duplicate.
QVariantMap getMap(void); QVariantMap getMap(void);
virtual QString getType(void) const virtual QString getType(void) const
{ {
return "Satellite"; return "Satellite";
} }
skipping to change at line 86 skipping to change at line 86
//! - Name: designation in large type with the description underneat h //! - Name: designation in large type with the description underneat h
//! - RaDecJ2000, RaDecOfDate, HourAngle, AltAzi //! - RaDecJ2000, RaDecOfDate, HourAngle, AltAzi
//! - Extra1: range, rage rate and altitude of satellite above the E arth //! - Extra1: range, rage rate and altitude of satellite above the E arth
//! - Extra2: Comms frequencies, modulation types and so on. //! - Extra2: Comms frequencies, modulation types and so on.
virtual QString getInfoString(const StelCore *core, const InfoString Group& flags) const; virtual QString getInfoString(const StelCore *core, const InfoString Group& flags) const;
virtual Vec3f getInfoColor(void) const; virtual Vec3f getInfoColor(void) const;
virtual Vec3d getJ2000EquatorialPos(const StelCore*) const virtual Vec3d getJ2000EquatorialPos(const StelCore*) const
{ {
return XYZ; return XYZ;
} }
virtual float getVMagnitude(const StelCore* core=NULL) const; virtual float getVMagnitude(const StelCore* core=NULL, bool withExti nction=false) const;
virtual double getAngularSize(const StelCore* core) const; virtual double getAngularSize(const StelCore* core) const;
virtual QString getNameI18n(void) const virtual QString getNameI18n(void) const
{ {
return designation; return name;
} }
virtual QString getEnglishName(void) const virtual QString getEnglishName(void) const
{ {
return designation; return name;
} }
//! Set new tleElements. This assumes the designation is already se t, populates //! Set new tleElements. This assumes the designation is already se t, populates
//! the tleElements values and configures internal orbit parameters. //! the tleElements values and configures internal orbit parameters.
void setNewTleElements(const QString& tle1, const QString& tle2); void setNewTleElements(const QString& tle1, const QString& tle2);
// calculate faders, new position // calculate faders, new position
void update(double deltaTime); void update(double deltaTime);
double getDoppler(double freq) const; double getDoppler(double freq) const;
static float showLabels; static float showLabels;
static double roundToDp(float n, int dp); static double roundToDp(float n, int dp);
// when the observer location changes we need to // when the observer location changes we need to
void recalculateOrbitLines(void); void recalculateOrbitLines(void);
void setNew() {newlyAdded = true;}
bool isNew() const {return newlyAdded;}
static QString extractInternationalDesignator(const QString& tle1);
public: public:
void enableDrawOrbit(bool b); void enableDrawOrbit(bool b);
private: private:
//draw orbits methods //draw orbits methods
void computeOrbitPoints(); void computeOrbitPoints();
void drawOrbit(StelPainter& painter); void drawOrbit(StelPainter& painter);
//! returns 0 - 1.0 for the DRAWORBIT_FADE_NUMBER segments at //! returns 0 - 1.0 for the DRAWORBIT_FADE_NUMBER segments at
//! each end of an orbit, with 1 in the middle. //! each end of an orbit, with 1 in the middle.
float calculateOrbitSegmentIntensity(int segNum); float calculateOrbitSegmentIntensity(int segNum);
void setNightColors(bool night); void setNightColors(bool night);
private: private:
bool initialized; bool initialized;
bool visible; bool visible;
bool orbitVisible; //draw orbit enabled/disabled bool orbitVisible; // draw orbit enabled/disabled
bool newlyAdded;
QString designation; // The ID of the satellite bool orbitValid;
QString description; // longer description of spacecra
ft //! Identifier of the satellite, must be unique within the list.
Vec3d XYZ; // holds J2000 position //! Currently, the Satellite Catalog Number is used. It is contained
in both
//! numbered lines of TLE sets.
QString id;
//! Human-readable name of the satellite.
//! Usually the string in the "Title line" of TLE sets.
QString name;
//! Longer description of the satellite.
QString description;
//! International Designator / COSPAR designation / NSSDC ID
QString internationalDesignator;
//! Contains the J2000 position
Vec3d XYZ;
QPair< QByteArray, QByteArray > tleElements; QPair< QByteArray, QByteArray > tleElements;
double height, range, rangeRate; double height, range, rangeRate;
QList<commLink> comms; QList<commLink> comms;
Vec3f hintColor; Vec3f hintColor;
QStringList groupIDs; QStringList groupIDs;
QDateTime lastUpdated; QDateTime lastUpdated;
static StelTextureSP hintTexture; static StelTextureSP hintTexture;
static SphericalCap viewportHalfspace; static SphericalCap viewportHalfspace;
static float hintBrightness; static float hintBrightness;
 End of changes. 8 change blocks. 
15 lines changed or deleted 33 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/