Isis 3.0 Programmer Reference
Back | Home
ControlMeasureLogData.cpp
2 
3 #include <QVariant>
4 
5 #include "ControlNetFileV0001.pb.h"
6 #include "ControlNetFileV0002.pb.h"
7 #include "PvlKeyword.h"
8 #include "SpecialPixel.h"
9 
10 namespace Isis {
15  Init();
16  }
17 
18 
26  double value) {
27  p_dataType = dataType;
28  p_numericalValue = value;
29  }
30 
31 
39  Init();
40  p_dataType = dataType;
41  }
42 
43 
52  Init();
53 
54  QString name = keywordRep.name();
55  p_dataType = NameToDataType(name);
57  p_numericalValue = toDouble(keywordRep[0]);
58  }
59 
60 
69  p_dataType = (NumericLogDataType)protoBuf.datatype();
70  p_numericalValue = protoBuf.datavalue();
71  }
72 
73 
82  if(protoBuf.has_doubledatatype()) {
83  p_dataType = (NumericLogDataType)protoBuf.doubledatatype();
84  p_numericalValue = protoBuf.doubledatavalue();
85  }
86  }
87 
88 
95  other) {
96  p_dataType = other.p_dataType;
98  }
99 
100 
105  }
106 
107 
115  }
116 
117 
124  p_numericalValue = value;
125  }
126 
127 
135  Init();
136  p_dataType = newDataType;
137  }
138 
139 
147  return p_numericalValue;
148  }
149 
150 
159  return p_dataType;
160  }
161 
162 
168  return QVariant(p_numericalValue);
169  }
170 
171 
178  return (p_numericalValue != Null) &&
180  }
181 
182 
190  if(IsValid())
192  else
193  return PvlKeyword();
194  }
195 
196 
205  if(!IsValid()) {
206  IString msg = "Cannot write an invalid log data entry to binary format";
208  }
209 
211 
212  protoBufDataEntry.set_doubledatatype(p_dataType);
213  protoBufDataEntry.set_doubledatavalue(p_numericalValue);
214 
215  return protoBufDataEntry;
216  }
217 
218 
227  QString name) const {
228  for (int i = InvalidNumericLogDataType + 1;
229  i < MaximumNumericLogDataType; i++) {
230  try {
231  QString thisTypeName = DataTypeToName((NumericLogDataType) i);
232 
233  if (name == thisTypeName) {
234  return (NumericLogDataType) i;
235  }
236  }
237  catch (IException &) {
238  }
239  }
240 
242  }
243 
244 
253  switch(type) {
255  IString msg = "Cannot convert an invalid data type to a string";
257  }
258 
260  return "Obsolete_Eccentricity";
261 
262  case GoodnessOfFit:
263  return "GoodnessOfFit";
264 
265  case MinimumPixelZScore:
266  return "MinimumPixelZScore";
267 
268  case MaximumPixelZScore:
269  return "MaximumPixelZScore";
270 
271  case PixelShift:
272  return "PixelShift";
273 
275  return "WholePixelCorrelation";
276 
277  case SubPixelCorrelation:
278  return "SubPixelCorrelation";
279 
281  return "Obsolete_AverageResidual";
282  }
283 
284  QString msg = "Unknown data type [" + toString(type) + "]";
286  }
287 }
NumericLogDataType GetDataType() const
Get the data type associated with this log data.
void Init()
This is a helper method for the constructor that initializes the data to a default, invalid state.
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:109
Deprecated keyword kept for backwards compatability with older Control Networks.
NumericLogDataType
Please do not change existing values in this list except the size - it will break backwards compadibi...
Deprecated keyword kept for backwards compatability with older Control Networks.
Statistical and similar ControlMeasure associated information.
double GetNumericalValue() const
Get the value associated with this log data.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:226
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:164
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:154
ControlPointFileEntryV0002_Measure_MeasureLogData ToProtocolBuffer() const
This converts the log data to a protocol buffer object.
Control measures store z-scores in pairs.
double p_numericalValue
The actual value of the data.
Deprecated keyword kept for backwards compatability with older Control Networks.
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:38
QString name() const
Returns the keyword name.
Definition: PvlKeyword.h:114
static const int MaximumNumericLogDataType
This value must be &gt; the largest enumerated value in this type or convertions to and from Pvl will no...
A single keyword-value pair.
Definition: PvlKeyword.h:98
bool IsValid() const
This tests if the log data is complete and valid.
GoodnessOfFit is pointreg information for reference measures.
void SetNumericalValue(double)
This updates the value associated with a NumericLogDataType.
QVariant GetValue() const
Get the data type associated with this log data.
Deprecated keyword kept for backwards compatability with older Control Networks.
NumericLogDataType p_dataType
Which kind of value are we storing.
Isis exception class.
Definition: IException.h:99
QString DataTypeToName(NumericLogDataType) const
This converts the log data type to a string and is used internally for convertions to and from Pvl...
Adds specific functionality to C++ strings.
Definition: IString.h:179
Deprecated keyword kept for backwards compatability with older Control Networks.
ControlMeasureLogData()
This creates an empty, invalid (IsValid() will return false), instance.
void SetDataType(NumericLogDataType)
This changes the type of this log data.
PvlKeyword ToKeyword() const
This converts the log data to a PvlKeyword.
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...

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:16:23