Isis 3 Programmer Reference
ControlMeasureLogData.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "ControlMeasureLogData.h"
10
11#include <QVariant>
12
13#include "PvlKeyword.h"
14#include "SpecialPixel.h"
15
16namespace Isis {
23
24
32 double value) {
33 p_dataType = dataType;
34 p_numericalValue = value;
35 }
36
37
48
49
58 Init();
59
60 QString name = keywordRep.name();
63 p_numericalValue = toDouble(keywordRep[0]);
64 }
65
72 other) {
73 p_dataType = other.p_dataType;
74 p_numericalValue = other.p_numericalValue;
75 }
76
77
83
84
93
94
101 p_numericalValue = value;
102 }
103
104
112 Init();
113 p_dataType = newDataType;
114 }
115
116
126
127
138
139
145 return QVariant(p_numericalValue);
146 }
147
148
158
159
172
181 QString name) const {
182 for (int i = InvalidNumericLogDataType + 1;
183 i < MaximumNumericLogDataType; i++) {
184 try {
185 QString thisTypeName = DataTypeToName((NumericLogDataType) i);
186
187 if (name.compare(thisTypeName, Qt::CaseInsensitive) == 0) {
188 return (NumericLogDataType) i;
189 }
190 }
191 catch (IException &) {
192 }
193 }
194
196 }
197
198
207 switch(type) {
209 IString msg = "Cannot convert an invalid data type to a string";
210 throw IException(IException::Programmer, msg, _FILEINFO_);
211 }
212
214 return "Obsolete_Eccentricity";
215
216 case GoodnessOfFit:
217 return "GoodnessOfFit";
218
220 return "MinimumPixelZScore";
221
223 return "MaximumPixelZScore";
224
225 case PixelShift:
226 return "PixelShift";
227
229 return "WholePixelCorrelation";
230
232 return "SubPixelCorrelation";
233
235 return "Obsolete_AverageResidual";
236 }
237
238 QString msg = "Unknown data type [" + toString(type) + "]";
239 throw IException(IException::Programmer, msg, _FILEINFO_);
240 }
241}
Statistical and similar ControlMeasure associated information.
static const int MaximumNumericLogDataType
This value must be > the largest enumerated value in this type or convertions to and from Pvl will no...
NumericLogDataType NameToDataType(QString name) const
This converts a string to a log data type and is useful for converting Pvl keywords to Numeric Log Da...
PvlKeyword ToKeyword() const
This converts the log data to a PvlKeyword.
NumericLogDataType GetDataType() const
Get the data type associated with this log data.
NumericLogDataType
Please do not change existing values in this list except the size - it will break backwards compadibi...
@ InvalidNumericLogDataType
This is a placeholder for unset values.
@ WholePixelCorrelation
Deprecated keyword kept for backwards compatability with older Control Networks.
@ MinimumPixelZScore
Control measures store z-scores in pairs.
@ GoodnessOfFit
GoodnessOfFit is pointreg information for reference measures.
@ Obsolete_Eccentricity
Deprecated keyword kept for backwards compatability with older Control Networks.
@ PixelShift
Deprecated keyword kept for backwards compatability with older Control Networks.
@ SubPixelCorrelation
Deprecated keyword kept for backwards compatability with older Control Networks.
@ Obsolete_AverageResidual
Deprecated keyword kept for backwards compatability with older Control Networks.
double GetNumericalValue() const
Get the value associated with this log data.
double p_numericalValue
The actual value of the data.
void SetNumericalValue(double value)
This updates the value associated with a NumericLogDataType.
ControlMeasureLogData()
This creates an empty, invalid (IsValid() will return false), instance.
void SetDataType(NumericLogDataType newDataType)
This changes the type of this log data.
QString DataTypeToName(NumericLogDataType type) const
This converts the log data type to a string and is used internally for convertions to and from Pvl.
void Init()
This is a helper method for the constructor that initializes the data to a default,...
bool IsValid() const
This tests if the log data is complete and valid.
NumericLogDataType p_dataType
Which kind of value are we storing.
QVariant GetValue() const
Get the data type associated with this log data.
Isis exception class.
Definition IException.h:91
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
Adds specific functionality to C++ strings.
Definition IString.h:165
A single keyword-value pair.
Definition PvlKeyword.h:87
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition IString.cpp:211
const double Null
Value for an Isis Null pixel.
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition IString.cpp:149