-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathqDFProjReport.cpp
More file actions
170 lines (145 loc) · 4.58 KB
/
qDFProjReport.cpp
File metadata and controls
170 lines (145 loc) · 4.58 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#include <QDataStream>
#include <QVector>
#include "qDFProjReport.hpp"
#include <sstream>
qDFProjReport::qDFProjReport(const std::vector <double> &theLocationUser,
const double &bearing, const double &std_dev,
const std::string &theName, const CoordSys &aCS,
const QString & equipmentType,
const QString & quality
)
:DFLib::Proj::Report(theLocationUser,bearing,std_dev,
theName, aCS.getProj4Params()),
theCS_(aCS),
equipmentType_(equipmentType),
quality_(quality)
{
}
qDFProjReport::~qDFProjReport()
{
}
void qDFProjReport::setReceiverLocationUser(const std::vector<double> &theLocation)
{
DFLib::Proj::Report::setReceiverLocationUser(theLocation);
emit reportChanged(this);
}
void qDFProjReport::setReceiverLocationMercator(const std::vector<double> &theLocation)
{
DFLib::Proj::Report::setReceiverLocationMercator(theLocation);
emit reportChanged(this);
}
void qDFProjReport::setBearing(double Bearing)
{
DFLib::Proj::Report::setBearing(Bearing);
emit reportChanged(this);
}
void qDFProjReport::setSigma(double Sigma)
{
DFLib::Proj::Report::setSigma(Sigma);
emit reportChanged(this);
}
void qDFProjReport::setUserProj(const std::vector<std::string> &projArgs)
{
DFLib::Proj::Report::setUserProj(projArgs);
emit reportChanged(this);
}
void qDFProjReport::setEquipType(const QString & equipType)
{
equipmentType_=equipType;
// We don't emit reportChanged because this doesn't actually impact
// the fix --- the caller must *also* call setSigma.
}
void qDFProjReport::setQuality(const QString & quality)
{
quality_=quality;
// We don't emit reportChanged because this doesn't actually impact
// the fix --- the caller must *also* call setSigma.
}
void qDFProjReport::setCS(const CoordSys & cs)
{
theCS_ = cs;
setUserProj(cs.getProj4Params()); // this does the emit of reportChanged
}
const QString & qDFProjReport::getEquipType() const
{
return equipmentType_;
}
const QString & qDFProjReport::getQuality() const
{
return quality_;
}
const QString qDFProjReport::getCSName() const
{
return theCS_.getName();
}
QVector<double> qDFProjReport::getReceiverLocationUser() const
{
QVector<double> theLoc(2);
std::vector<double> coords(2);
DFLib::Proj::Point tempPoint=getReceiverPoint();
coords = tempPoint.getUserCoords();
theLoc[1]=coords[0];
theLoc[0]=coords[1];
return theLoc;
}
void qDFProjReport::toggleValidity()
{
DFLib::Proj::Report::toggleValidity();
emit reportChanged(this);
}
QString qDFProjReport::getReportNameQS() const
{
QString name=QString::fromStdString(getReportName());
return (name);
}
void qDFProjReport::setAll(const std::vector<double> &theLocationUser,
const double &bearing,
const double &std_dev,
const CoordSys &CS,
const QString &equipmentType,
const QString &quality)
{
setCS(CS);
setEquipType(equipmentType);
setQuality(quality);
DFLib::Proj::Report::setReceiverLocationUser(theLocationUser);
DFLib::Proj::Report::setBearing(bearing);
DFLib::Proj::Report::setSigma(std_dev);
emit reportChanged(this); // this is redundant, since setCS did it, but let's
// be sure, just in case there's a queueing issue.
}
QString qDFProjReport::getReportSummary(const std::vector<std::string> &projArgs) const
{
// Get a copy of the point
DFLib::Proj::Point tempPoint=getReceiverPoint();
tempPoint.setUserProj(projArgs);
// get the coordinates in our requested projection (which might not be the
// one that the report uses
std::vector <double> coords(2);
coords=tempPoint.getUserCoords();
// Our summary will be "name lon lat bearing sd validity"
std::ostringstream os;
os << getReportName() << " " << coords[0] << " " << coords[1] << " "
<< getBearing() << " " << getSigma();
if (isValid())
os << " Valid ";
else
os << " Invalid ";
return (QString::fromStdString(os.str()));
}
QDataStream &operator<<(QDataStream &out,const qDFProjReport &tR)
{
// Get a copy of the point
DFLib::Proj::Point tempPoint=tR.getReceiverPoint();
std::vector <double> coords(2);
coords=tempPoint.getUserCoords();
out << QString::fromStdString(tR.getReportName());
out << coords[0] << coords[1]
<< tR.getBearing() << tR.getSigma();
out << tR.isValid()
<< tR.theCS_.getBaseName()
<< quint32(tR.theCS_.getZone());
out << tR.getEquipType();
out << tR.getQuality();
return out;
}