-
Notifications
You must be signed in to change notification settings - Fork 2
/
Satellite.h
50 lines (33 loc) · 882 Bytes
/
Satellite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef __SATELLITE_H__
#define __SATELLITE_H__
#include <QString>
#include <CoordTopocentric.h>
#include <CoordGeodetic.h>
#include <Observer.h>
#include <SGP4.h>
class Satellite : public SGP4
{
public:
Satellite(const Tle& tle, QString name = "") :
SGP4(tle),
mName(name),
mNORADID(tle.Name().c_str())
{
if(name.isEmpty())
name = tle.Name().c_str();
}
virtual ~Satellite() {}
const QString name() const { return mName; }
const QString NORADId() const { return mNORADID; }
const CoordGeodetic& latestPosition() const { return latestPos; }
void update() {
DateTime now = DateTime::Now(true);
Eci eci = FindPosition(now);
latestPos = eci.ToGeodetic();
}
private:
QString mName;
QString mNORADID;
CoordGeodetic latestPos;
};
#endif // __SATELLITE_H__