forked from utat-uav/Software
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlifesupport.cpp
More file actions
36 lines (28 loc) · 747 Bytes
/
lifesupport.cpp
File metadata and controls
36 lines (28 loc) · 747 Bytes
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
#include "lifesupport.h"
LifeSupport::LifeSupport(QProcess *classifier, QTextBrowser *consoleOutput){
this->classifier=classifier;
this->consoleOutput=consoleOutput;
}
LifeSupport::~LifeSupport(){
delete classifier;
delete consoleOutput;
}
/*
* avg is in degrees
*/
QPointF LatLon::convertToXY(double avgLat)
{
return QPointF(lon * std::cos(avgLat * DEG_TO_RAD), lat);
}
LatLon LatLon::xyToLatLon(QPointF xy, double avgLat)
{
LatLon latlon;
latlon.lat = xy.y();
latlon.lon = xy.x() / std::cos(avgLat * DEG_TO_RAD);
return latlon;
}
QString TargetData::idStr()
{
// relevant fields separated by a colon
return QString(alphanumeric) + ":" + shape + ":" + shapeColor + ":" + alphanumericColor;
}