forked from kimphg/Jupiter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
c_arpa_data.h
74 lines (70 loc) · 1.99 KB
/
c_arpa_data.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef C_ARPA_DATA_H
#define C_ARPA_DATA_H
#include <vector>
#include <QDateTime>
#include <QStringList>
#ifndef CONST_NM
#define CONST_NM 1.825f
#endif
typedef struct {
float centerA,centerR;//
float centerX,centerY;//in km
float course ;
float velocity;
qint64 time;
}ARPA_object_t;
class AIS_object_t {
public:
AIS_object_t();
QString printData();
QString mName,mDst;
int mMMSI;
int mImo;
int mNavStat;
int mType;
int mBow,mStern,mStarboard,mPort;
double mLat;//in deg
double mLong;//in deg
double mCog;//course
double mSog;//speed
qint64 mLut;//last update time
bool isNewest;
bool isSelected;
};
typedef std::vector<ARPA_object_t> ArpaobjectList;
class ARPA_track
{
public:
ARPA_track():id(0),selected(false){}
ArpaobjectList object_list;
void addObject(ARPA_object_t*newobj)
{
object_list.push_back(*newobj);
centerX = newobj->centerX;
centerY = newobj->centerY;
centerA = newobj->centerA;
centerR = newobj->centerR;
course = newobj->course ;
velocity = newobj->velocity;
lives = 20;
}
float centerX,centerY;
float centerA,centerR;
float course ;
float velocity;
short id;
bool selected;
unsigned short lives;
};
class C_ARPA_data
{
public:
C_ARPA_data();
~C_ARPA_data();
void SortTrack();
void processData(char *data, unsigned short len);
std::vector<ARPA_track> track_list;
void addARPA(short id, float r, float a, float course, float velocity);
void addAIS(std::string id, float mlat, float mlong, float course, float velocity);
};
#endif // C_ARPA_DATA_H