Isis 3 Programmer Reference
ControlMeasureLogData.cpp
2 
3 #include <QVariant>
4 
5 #include "PvlKeyword.h"
6 #include "SpecialPixel.h"
7 
8 namespace Isis {
13  Init();
14  }
15 
16 
24  double value) {
25  p_dataType = dataType;
26  p_numericalValue = value;
27  }
28 
29 
37  Init();
38  p_dataType = dataType;
39  }
40 
41 
50  Init();
51 
52  QString name = keywordRep.name();
53  p_dataType = NameToDataType(name);
55  p_numericalValue = toDouble(keywordRep[0]);
56  }
57 
64  other) {
65  p_dataType = other.p_dataType;
67  }
68 
69 
74  }
75 
76 
84  }
85 
86 
93  p_numericalValue = value;
94  }
95 
96 
104  Init();
105  p_dataType = newDataType;
106  }
107 
108 
116  return p_numericalValue;
117  }
118 
119 
128  return p_dataType;
129  }
130 
131 
137  return QVariant(p_numericalValue);
138  }
139 
140 
147  return (p_numericalValue != Null) &&
149  }
150 
151 
159  if(IsValid())
161  else
162  return PvlKeyword();
163  }
164 
173  QString name) const {
174  for (int i = InvalidNumericLogDataType + 1;
175  i < MaximumNumericLogDataType; i++) {
176  try {
177  QString thisTypeName = DataTypeToName((NumericLogDataType) i);
178 
179  if (name == thisTypeName) {
180  return (NumericLogDataType) i;
181  }
182  }
183  catch (IException &) {
184  }
185  }
186 
188  }
189 
190 
199  switch(type) {
201  IString msg = "Cannot convert an invalid data type to a string";
203  }
204 
206  return "Obsolete_Eccentricity";
207 
208  case GoodnessOfFit:
209  return "GoodnessOfFit";
210 
211  case MinimumPixelZScore:
212  return "MinimumPixelZScore";
213 
214  case MaximumPixelZScore:
215  return "MaximumPixelZScore";
216 
217  case PixelShift:
218  return "PixelShift";
219 
221  return "WholePixelCorrelation";
222 
223  case SubPixelCorrelation:
224  return "SubPixelCorrelation";
225 
227  return "Obsolete_AverageResidual";
228  }
229 
230  QString msg = "Unknown data type [" + toString(type) + "]";
232  }
233 }
void Init()
This is a helper method for the constructor that initializes the data to a default, invalid state.
PvlKeyword ToKeyword() const
This converts the log data to a PvlKeyword.
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:110
NumericLogDataType GetDataType() const
Get the data type associated with this log data.
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...
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.
void SetNumericalValue(double value)
This updates the value associated with a NumericLogDataType.
QVariant GetValue() const
Get the data type 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:162
Control measures store z-scores in pairs.
double p_numericalValue
The actual value of the data.
bool IsValid() const
This tests if the log data is complete and valid.
Deprecated keyword kept for backwards compatability with older Control Networks.
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
static const int MaximumNumericLogDataType
This value must be > the largest enumerated value in this type or convertions to and from Pvl will no...
A single keyword-value pair.
Definition: PvlKeyword.h:98
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 SetDataType(NumericLogDataType newDataType)
This changes the type of this log data.
GoodnessOfFit is pointreg information for reference measures.
Deprecated keyword kept for backwards compatability with older Control Networks.
NumericLogDataType p_dataType
Which kind of value are we storing.
QString name() const
Returns the keyword name.
Definition: PvlKeyword.h:114
Isis exception class.
Definition: IException.h:107
Adds specific functionality to C++ strings.
Definition: IString.h:181
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Deprecated keyword kept for backwards compatability with older Control Networks.
double GetNumericalValue() const
Get the value associated with this log data.
ControlMeasureLogData()
This creates an empty, invalid (IsValid() will return false), instance.