Changeset View
Changeset View
Standalone View
Standalone View
kstars/skyobjects/satellite.h
Context not available. | |||||
15 | * * | 15 | * * | ||
---|---|---|---|---|---|
16 | ***************************************************************************/ | 16 | ***************************************************************************/ | ||
17 | 17 | | |||
18 | #ifndef SATELLITE_H | 18 | #pragma once | ||
19 | #define SATELLITE_H | | |||
20 | | ||||
21 | #include <QString> | | |||
22 | 19 | | |||
23 | #include "skyobject.h" | 20 | #include "skyobject.h" | ||
24 | #include "skypoint.h" | 21 | | ||
22 | #include <QString> | ||||
25 | 23 | | |||
26 | class KSPopupMenu; | 24 | class KSPopupMenu; | ||
27 | 25 | | |||
28 | /** | 26 | /** | ||
29 | *@class Satellite | 27 | * @class Satellite | ||
30 | *Represents an artificial satellites. | 28 | * Represents an artificial satellites. | ||
31 | *@author Jérôme SONRIER | 29 | * | ||
32 | *@version 0.1 | 30 | * @author Jérôme SONRIER | ||
33 | */ | 31 | * @version 0.1 | ||
32 | */ | ||||
34 | class Satellite : public SkyObject | 33 | class Satellite : public SkyObject | ||
35 | { | 34 | { | ||
36 | public: | 35 | public: | ||
37 | /** | 36 | /** @short Constructor */ | ||
38 | *@short Constructor | 37 | Satellite(const QString &name, const QString &line1, const QString &line2); | ||
39 | */ | | |||
40 | Satellite(QString name, QString line1, QString line2); | | |||
41 | 38 | | |||
42 | /** | 39 | /** | ||
43 | *@return a clone of this object | 40 | * @return a clone of this object | ||
44 | *@note See SkyObject::clone() | 41 | * @note See SkyObject::clone() | ||
45 | */ | 42 | */ | ||
46 | Satellite *clone() const Q_DECL_OVERRIDE; | 43 | Satellite *clone() const Q_DECL_OVERRIDE; | ||
47 | 44 | | |||
48 | /** | 45 | /** @short Destructor */ | ||
49 | *@short Destructor | | |||
50 | */ | | |||
51 | ~Satellite(); | 46 | ~Satellite(); | ||
52 | 47 | | |||
53 | /** | 48 | /** @short Update satellite position */ | ||
54 | *@short Update satellite position | | |||
55 | */ | | |||
56 | int updatePos(); | 49 | int updatePos(); | ||
57 | 50 | | |||
58 | /** | 51 | /** | ||
59 | *@return True if the satellite is visible (above horizon, in the sunlight and sun at least 12° under horizon) | 52 | * @return True if the satellite is visible (above horizon, in the sunlight and sun at least 12° under horizon) | ||
60 | */ | 53 | */ | ||
61 | bool isVisible(); | 54 | bool isVisible(); | ||
62 | 55 | | |||
63 | /** | 56 | /** @return True if the satellite is selected */ | ||
64 | *@return True if the satellite is selected | | |||
65 | */ | | |||
66 | bool selected(); | 57 | bool selected(); | ||
67 | 58 | | |||
68 | /** | 59 | /** @short Select or not the satellite */ | ||
69 | *@short Select or not the satellite | | |||
70 | */ | | |||
71 | void setSelected(bool selected); | 60 | void setSelected(bool selected); | ||
72 | 61 | | |||
73 | /** | 62 | /** @return Satellite velocity in km/s */ | ||
74 | *@return Satellite velocity in km/s | | |||
75 | */ | | |||
76 | double velocity(); | 63 | double velocity(); | ||
77 | 64 | | |||
78 | /** | 65 | /** @return Satellite altitude in km */ | ||
79 | *@return Satellite altitude in km | | |||
80 | */ | | |||
81 | double altitude(); | 66 | double altitude(); | ||
82 | 67 | | |||
83 | /** | 68 | /** @return Satellite range from observer in km */ | ||
84 | *@return Satellite range from observer in km | | |||
85 | */ | | |||
86 | double range(); | 69 | double range(); | ||
87 | 70 | | |||
88 | /** | 71 | /** @return Satellite international designator */ | ||
89 | *@return Satellite international designator | | |||
90 | */ | | |||
91 | QString id(); | 72 | QString id(); | ||
92 | 73 | | |||
93 | /** | 74 | /** | ||
94 | * @brief sgp4ErrorString Get error string associated with sgp4 calculation failure | 75 | * @brief sgp4ErrorString Get error string associated with sgp4 calculation failure | ||
95 | * @param code error code as returned from sgp4() function | 76 | * @param code error code as returned from sgp4() function | ||
96 | * @return error string | 77 | * @return error string | ||
97 | */ | 78 | */ | ||
98 | QString sgp4ErrorString(int code); | 79 | QString sgp4ErrorString(int code); | ||
99 | 80 | | |||
100 | void initPopupMenu(KSPopupMenu *pmenu) Q_DECL_OVERRIDE; | 81 | void initPopupMenu(KSPopupMenu *pmenu) Q_DECL_OVERRIDE; | ||
101 | 82 | | |||
102 | private: | 83 | private: | ||
103 | /** | 84 | /** @short Compute non time dependant parameters */ | ||
104 | *@short Compute non time dependant parameters | | |||
105 | */ | | |||
106 | void init(); | 85 | void init(); | ||
107 | 86 | | |||
108 | /** | 87 | /** @short Compute satellite position */ | ||
109 | *@short Compute satellite position | | |||
110 | */ | | |||
111 | int sgp4(double tsince); | 88 | int sgp4(double tsince); | ||
112 | 89 | | |||
113 | /** | 90 | /** @return Arcsine of the argument */ | ||
114 | *@return Arcsine of the argument | | |||
115 | */ | | |||
116 | double arcSin(double arg); | 91 | double arcSin(double arg); | ||
117 | 92 | | |||
118 | /** | 93 | /** | ||
119 | *Provides the difference between UT (approximately the same as UTC) | 94 | * Provides the difference between UT (approximately the same as UTC) | ||
120 | *and ET (now referred to as TDT). | 95 | * and ET (now referred to as TDT). | ||
121 | *This function is based on a least squares fit of data from 1950 | 96 | * This function is based on a least squares fit of data from 1950 | ||
122 | *to 1991 and will need to be updated periodically. | 97 | * to 1991 and will need to be updated periodically. | ||
123 | */ | 98 | */ | ||
124 | double deltaET(double year); | 99 | double deltaET(double year); | ||
125 | 100 | | |||
126 | /** | 101 | /** @return arg1 mod arg2 */ | ||
127 | *@return arg1 mod arg2 | | |||
128 | */ | | |||
129 | double Modulus(double arg1, double arg2); | 102 | double Modulus(double arg1, double arg2); | ||
130 | 103 | | |||
131 | // TLE | 104 | // TLE | ||
132 | int m_number; // Satellite Number | 105 | /// Satellite Number | ||
133 | QChar m_class; // Security Classification | 106 | int m_number { 0 }; | ||
134 | QString m_id; // International Designator | 107 | /// Security Classification | ||
135 | double m_epoch_year; // Epoch Year | 108 | QChar m_class; | ||
136 | double m_epoch; // Epoch (Day of the year and fractional portion of the day) | 109 | /// International Designator | ||
137 | double m_first_deriv; // First Time Derivative of the Mean Motion | 110 | QString m_id; | ||
138 | double m_second_deriv; // Second Time Derivative of Mean Motion | 111 | /// Epoch Year | ||
139 | double m_bstar; // BSTAR drag term (decimal point assumed) | 112 | double m_epoch_year { 0 }; | ||
140 | int m_ephem_type; // Ephemeris type | 113 | /// Epoch (Day of the year and fractional portion of the day) | ||
141 | int m_elem_number; // Element number | 114 | double m_epoch { 0 }; | ||
142 | double m_inclination; // Inclination [Radians] | 115 | /// First Time Derivative of the Mean Motion | ||
143 | double m_ra; // Right Ascension of the Ascending Node [Radians] | 116 | double m_first_deriv { 0 }; | ||
144 | double m_eccentricity; // Eccentricity | 117 | /// Second Time Derivative of Mean Motion | ||
145 | double m_arg_perigee; // Argument of Perigee [Radians] | 118 | double m_second_deriv { 0 }; | ||
146 | double m_mean_anomaly; // Mean Anomaly [Radians] | 119 | /// BSTAR drag term (decimal point assumed) | ||
147 | double m_mean_motion; // Mean Motion [Radians per minutes] | 120 | double m_bstar { 0 }; | ||
148 | int m_nb_revolution; // Revolution number at epoch [Revs] | 121 | /// Ephemeris type | ||
149 | double m_tle_jd; // TLE epoch converted to julian date | 122 | int m_ephem_type { 0 }; | ||
123 | /// Element number | ||||
124 | int m_elem_number { 0 }; | ||||
125 | /// Inclination [Radians] | ||||
126 | double m_inclination { 0 }; | ||||
127 | /// Right Ascension of the Ascending Node [Radians] | ||||
128 | double m_ra { 0 }; | ||||
129 | /// Eccentricity | ||||
130 | double m_eccentricity { 0 }; | ||||
131 | /// Argument of Perigee [Radians] | ||||
132 | double m_arg_perigee { 0 }; | ||||
133 | /// Mean Anomaly [Radians] | ||||
134 | double m_mean_anomaly { 0 }; | ||||
135 | /// Mean Motion [Radians per minutes] | ||||
136 | double m_mean_motion { 0 }; | ||||
137 | /// Revolution number at epoch [Revs] | ||||
138 | int m_nb_revolution { 0 }; | ||||
139 | /// TLE epoch converted to julian date | ||||
140 | double m_tle_jd { 0 }; | ||||
150 | 141 | | |||
151 | // Satellite | 142 | // Satellite | ||
152 | bool m_is_visible; // True if the satellite is visible | 143 | /// True if the satellite is visible | ||
153 | bool m_is_eclipsed; // True if the satellite is in the shadow of the earth | 144 | bool m_is_visible { false }; | ||
154 | bool m_is_selected; // True if the satellite is selected | 145 | /// True if the satellite is in the shadow of the earth | ||
155 | double m_velocity; // Satellite velocity in km/s | 146 | bool m_is_eclipsed { false }; | ||
156 | double m_altitude; // Satellite altitude in km | 147 | /// True if the satellite is selected | ||
157 | double m_range; // Satellite range from observer in km | 148 | bool m_is_selected { false }; | ||
149 | /// Satellite velocity in km/s | ||||
150 | double m_velocity { 0 }; | ||||
151 | /// Satellite altitude in km | ||||
152 | double m_altitude { 0 }; | ||||
153 | /// Satellite range from observer in km | ||||
154 | double m_range { 0 }; | ||||
158 | 155 | | |||
159 | // Near Earth | 156 | // Near Earth | ||
160 | bool isimp; | 157 | bool isimp { false }; | ||
161 | double aycof, con41, cc1, cc4, cc5, d2, d3, d4, delmo, eta, argpdot, omgcof, sinmao, t, t2cof, t3cof, t4cof, t5cof, | 158 | double aycof { 0 }, con41 { 0 }, cc1 { 0 }, cc4 { 0 }, cc5 { 0 }, d2 { 0 }, d3 { 0 }, d4 { 0 }; | ||
162 | x1mth2, x7thm1, mdot, nodedot, xlcof, xmcof, nodecf; | 159 | double delmo { 0 }, eta { 0 }, argpdot { 0 }, omgcof { 0 }, sinmao { 0 }, t { 0 }, t2cof { 0 }; | ||
160 | double t3cof { 0 }, t4cof { 0 }, t5cof { 0 }, x1mth2 { 0 }, x7thm1 { 0 }, mdot { 0 }; | ||||
161 | double nodedot { 0 }, xlcof { 0 }, xmcof { 0 }, nodecf { 0 }; | ||||
163 | 162 | | |||
164 | // Deep Space | 163 | // Deep Space | ||
165 | int irez; | 164 | int irez { 0 }; | ||
166 | double d2201, d2211, d3210, d3222, d4410, d4422, d5220, d5232, d5421, d5433, dedt, del1, del2, del3, didt, dmdt, | 165 | double d2201 { 0 }, d2211 { 0 }, d3210 { 0 }, d3222 { 0 }, d4410 { 0 }, d4422 { 0 }, d5220 { 0 }; | ||
167 | dnodt, domdt, e3, ee2, peo, pgho, pho, pinco, plo, se2, se3, sgh2, sgh3, sgh4, sh2, sh3, si2, si3, sl2, sl3, | 166 | double d5232 { 0 }, d5421 { 0 }, d5433 { 0 }, dedt { 0 }, del1 { 0 }, del2 { 0 }, del3 { 0 }; | ||
168 | sl4, gsto, xfact, xgh2, xgh3, xgh4, xh2, xh3, xi2, xi3, xl2, xl3, xl4, xlamo, zmol, zmos, atime, xli, xni; | 167 | double didt { 0 }, dmdt { 0 }, dnodt { 0 }, domdt { 0 }, e3 { 0 }, ee2 { 0 }, peo { 0 }; | ||
168 | double pgho { 0 }, pho { 0 }, pinco { 0 }, plo { 0 }, se2 { 0 }, se3 { 0 }, sgh2 { 0 }; | ||||
169 | double sgh3 { 0 }, sgh4 { 0 }, sh2 { 0 }, sh3 { 0 }, si2 { 0 }, si3 { 0 }, sl2 { 0 }, sl3 { 0 }; | ||||
170 | double sl4 { 0 }, gsto { 0 }, xfact { 0 }, xgh2 { 0 }, xgh3 { 0 }, xgh4 { 0 }, xh2 { 0 }; | ||||
171 | double xh3 { 0 }, xi2 { 0 }, xi3 { 0 }, xl2 { 0 }, xl3 { 0 }, xl4 { 0 }, xlamo { 0 }, zmol { 0 }; | ||||
172 | double zmos { 0 }, atime { 0 }, xli { 0 }, xni { 0 }; | ||||
169 | 173 | | |||
170 | char method; | 174 | char method; | ||
171 | }; | 175 | }; | ||
172 | | ||||
173 | #endif | | |||
Context not available. |