USGS

Isis 3.0 Object Programmers' Reference

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 }