Stellarium  0.16.1
gSatWrapper.hpp
1 /***************************************************************************
2  * Name: gSatStelWrapper.hpp
3  *
4  * Description: Wrapper over gSatTEME class.
5  * This class allow use Satellite orbit calculation module (gSAt) in
6  * Stellarium 'native' mode using Stellarium objects.
7  *
8  ***************************************************************************/
9 /***************************************************************************
10  * Copyright (C) 2006 by J.L. Canales *
11  * jlcanales.gasco@gmail.com *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the *
25  * Free Software Foundation, Inc., *
26  * 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. *
27  ***************************************************************************/
28 
29 #ifndef _GSATWRAPPER_HPP_
30 #define _GSATWRAPPER_HPP_ 1
31 
32 #include <QString>
33 
34 #include "VecMath.hpp"
35 
36 #include "gsatellite/gSatTEME.hpp"
37 #include "gsatellite/gTime.hpp"
38 
42 {
43 
44 public:
45  enum Visibility
46  {
47  //constants for visibility prediction
48  UNKNOWN=0,
49  RADAR_SUN=1,
50  VISIBLE=2,
51  RADAR_NIGHT=3,
52  NOT_VISIBLE=4
53  };
54  gSatWrapper(QString designation, QString tle1,QString tle2);
55  ~gSatWrapper();
56 
57  // Operation setEpoch
60  void setEpoch(double ai_julianDaysEpoch);
61 
62  // Operation getTEMEPos
65  Vec3d getTEMEPos() const;
66 
67  // Operation getSunECIPos
70  static Vec3d getSunECIPos();
71 
72  // Operation getTEMEVel
75  Vec3d getTEMEVel() const;
76 
77  // Operation: getSubPoint
83  Vec3d getSubPoint() const;
84 
85  // Operation getAltAz
92  Vec3d getAltAz() const;
93 
94  // Operation getSlantRange
100  void getSlantRange(double &ao_slantRange, double &ao_slantRangeRate) const; //measured in km and km/s
101 
102 
103  // Operation getVisibilityPredict
118  Visibility getVisibilityPredict();
119 
120  double getPhaseAngle() const;
121  gTime getEpoch() const { return epoch; }
122 
123 
124 //private:
125  // Operation calcObserverECIPosition
137  static void calcObserverECIPosition(Vec3d& ao_position, Vec3d& ao_vel) ;
138 
139 
140 private:
142  static void updateSunECIPos();
143 
144  gSatTEME *pSatellite;
145  static gTime epoch;
146 
147  // GZ We can avoid many computations (solar and observer positions for every satellite) by computing them only once for all objects.
148  static gTime lastSunECIepoch; // store last time of computation to avoid all-1 computations.
149  static Vec3d sunECIPos; // enough to have these once.
150  static Vec3d observerECIPos;
151  static Vec3d observerECIVel;
152  static gTime lastCalcObserverECIPosition;
153 
154 };
155 
156 #endif
Vec3d getTEMEPos() const
This operation isolate gSatTEME getPos operation.
Sat position and velocity predictions over TEME reference system.
Definition: gSatTEME.hpp:54
Wrapper allowing compatibility between gsat and Stellarium/Qt.
Definition: gSatWrapper.hpp:41
Vec3d getTEMEVel() const
This operation isolate gSatTEME getVel operation.
void getSlantRange(double &ao_slantRange, double &ao_slantRangeRate) const
This operation compute the slant range (distance between the satellite and the observer) and its vari...
Vec3d getAltAz() const
This operation compute the coordinates in StelCore::FrameAltAz.
Vec3d getSubPoint() const
This operation isolate getSubPoint method of gSatTEME object.
Visibility getVisibilityPredict()
This operation predicts the satellite visibility contidions.
static void calcObserverECIPosition(Vec3d &ao_position, Vec3d &ao_vel)
This operation computes the observer ECI coordinates in Geocentric Equatorial Coordinate System (IJK)...
This class implements time calculations.
Definition: gTime.hpp:143
void setEpoch(double ai_julianDaysEpoch)
This operation update Epoch timestamp for gSatTEME object from Stellarium Julian Date.
static Vec3d getSunECIPos()
Get Sun positions in ECI system.