8 MeasureValidationResults::MeasureValidationResults() {
13 errorMsg =
new QString();
17 MeasureValidationResults::~MeasureValidationResults() {
18 if (failures != NULL) {
22 if (errorMsg != NULL) {
29 bool MeasureValidationResults::isValid() {
30 return failures->size() == 0;
34 bool MeasureValidationResults::getValidStatus(Option opt) {
35 return !failures->contains(opt);
39 QString MeasureValidationResults::toString() {
40 return ((errorMsg->isEmpty()) ?
"succeeded" : (*errorMsg));
44 QString MeasureValidationResults::toString(QString serialNumber, QString pointID) {
45 return "Control Measure with Serial Number " + serialNumber +
46 " in Control Point " + pointID +
" " +
47 ((errorMsg->isEmpty()) ?
"succeeded" : (*errorMsg));
51 QString MeasureValidationResults::toString(QString sample, QString line,
52 QString serialNumber, QString pointID) {
53 return "Control Measure with position (" + sample +
", " + line +
54 ") of Serial Number " + serialNumber +
55 " in Control Point " + pointID +
" " +
56 ((errorMsg->isEmpty()) ?
"succeeded" : (*errorMsg));
60 void MeasureValidationResults::addFailure(Option opt,
double tolerance,
const char* compare) {
61 failures->push_back(opt);
63 QString failureReason = getFailurePrefix(opt) +
"is " + compare +
" than tolerance " +
64 QString::number(tolerance);
65 errorMsg->append(failureReason);
69 void MeasureValidationResults::addFailure(Option opt,
double computed,
double min,
double max) {
70 failures->push_back(opt);
72 QString failureReason = getFailurePrefix(opt) + QString::number(computed) +
73 " is outside range [" + QString::number(min) +
", " +
74 QString::number(max) +
"]";
75 errorMsg->append(failureReason);
79 QString MeasureValidationResults::getFailurePrefix(Option opt) {
80 QString optString =
"\n ";
83 optString +=
"Emission Angle";
86 optString +=
"Incidence Angle";
89 optString +=
"DN Value";
92 optString +=
"Resolution";
95 optString +=
"Pixels From Edge";
98 optString +=
"Meters From Edge";
101 optString +=
"Sample Residual";
104 optString +=
"Line Residual";
106 case ResidualMagnitude:
107 optString +=
"Residual Magnitude";
110 optString +=
"Sample Shift";
113 optString +=
"Line Shift";
116 optString +=
"Pixel Shift";
121 return ((errorMsg->isEmpty()) ?
"failed: " :
"") + optString;
Namespace for ISIS/Bullet specific routines.