Loading isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp +24 −31 Original line number Diff line number Diff line Loading @@ -2,9 +2,14 @@ #include <QString> #include "ControlPointV0001.h" #include "ControlMeasureLogData.h" #include "Distance.h" #include "IException.h" #include "Latitude.h" #include "Longitude.h" #include "NaifStatus.h" #include "Pvl.h" #include "PvlContainer.h" #include "SurfacePoint.h" #include "Target.h" Loading Loading @@ -82,13 +87,13 @@ namespace Isis { else if ( pointObject.hasKeyword("X") && pointObject.hasKeyword("Y") && pointObject.hasKeyword("Z") ) { m_pointData->set_adjustedx( pointObject["Latitude"][0] ); m_pointData->set_adjustedy( pointObject["Longitude"][0] ); m_pointData->set_adjustedz( pointObject["Radius"][0] ); m_pointData->set_adjustedx( toDouble(pointObject["Latitude"][0]) ); m_pointData->set_adjustedy( toDouble(pointObject["Longitude"][0]) ); m_pointData->set_adjustedz( toDouble(pointObject["Radius"][0]) ); } else { QString msg = "Unable to find adjusted surface point values for the control point."; throw IException(e, IException::Io, msg, _FILEINFO_); throw IException(IException::Io, msg, _FILEINFO_); } // copy over the apriori surface point Loading @@ -114,7 +119,7 @@ namespace Isis { } else { QString msg = "Unable to find apriori surface point values for the control point."; throw IException(e, IException::Io, msg, _FILEINFO_); throw IException(IException::Io, msg, _FILEINFO_); } // Ground points were previously flagged by the Held keyword being true. Loading Loading @@ -318,7 +323,7 @@ namespace Isis { // Process Measures for (int groupIndex = 0; groupIndex < pointObject.groups(); groupIndex ++) { PvlGroup &group = pointObject.group(groupIndex); ControlNetFileProtoV0001_PBControlPoint::PBControlMeasure measure; ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure measure; // Copy strings, booleans, and doubles copy(group, "SerialNumber", Loading Loading @@ -349,7 +354,7 @@ namespace Isis { if (group.hasKeyword("Sample")) { // The sample may not be a numeric value // in this case set it to 0 and ignore the measure double value double value; try { value = toDouble(group["Sample"][0]); } Loading @@ -357,13 +362,13 @@ namespace Isis { value = 0; m_pointData->set_ignore(true); } measure.measurement().set_sample(value); measure.mutable_measurement()->set_sample(value); group.deleteKeyword("Sample"); } if (group.hasKeyword("Line")) { // The line may not be a numeric value // in this case set it to 0 and ignore the measure double value double value; try { value = toDouble(group["Line"][0]); } Loading @@ -371,17 +376,17 @@ namespace Isis { value = 0; m_pointData->set_ignore(true); } measure.measurement().set_line(value); measure.mutable_measurement()->set_line(value); group.deleteKeyword("Line"); } if (group.hasKeyword("ErrorSample")) { double value = toDouble(group["ErrorSample"][0]); measure.measurement().set_sampleresidual(value); measure.mutable_measurement()->set_sampleresidual(value); group.deleteKeyword("ErrorSample"); } if (group.hasKeyword("ErrorLine")) { double value = toDouble(group["ErrorLine"][0]); measure.measurement().set_lineresidual(value); measure.mutable_measurement()->set_lineresidual(value); group.deleteKeyword("ErrorLine"); } Loading Loading @@ -428,18 +433,6 @@ namespace Isis { } } for (int key = 0; key < group.keywords(); key++) { ControlMeasureLogData interpreter(group[key]); if (!interpreter.IsValid()) { QString msg = "Unhandled or duplicate keywords in control measure [" + group[key].name() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } else { *measure.add_log() = interpreter.ToProtocolBuffer(); } } *m_pointData->add_measures() = measure; } Loading Loading @@ -489,7 +482,7 @@ namespace Isis { value = value.toLower(); if (value == "true" || value == "yes") (point->*setter)(true); (point.data()->*setter)(true); } Loading @@ -509,7 +502,7 @@ namespace Isis { */ void ControlPointV0001::copy(PvlContainer &container, QString keyName, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> &point, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(double)) { if (!container.hasKeyword(keyName)) Loading @@ -517,7 +510,7 @@ namespace Isis { double value = toDouble(container[keyName][0]); container.deleteKeyword(keyName); (point->*setter)(value); (point.data()->*setter)(value); } Loading @@ -537,7 +530,7 @@ namespace Isis { */ void ControlPointV0001::copy(PvlContainer &container, QString keyName, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> &point, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(const std::string&)) { if (!container.hasKeyword(keyName)) Loading @@ -545,7 +538,7 @@ namespace Isis { QString value = container[keyName][0]; container.deleteKeyword(keyName); (point->*setter)(value); (point.data()->*setter)(value.toLatin1().data()); } Loading Loading @@ -633,6 +626,6 @@ namespace Isis { QString value = container[keyName][0]; container.deleteKeyword(keyName); (measure.*set)(value); (measure.*setter)(value.toLatin1().data()); } } isis/src/control/objs/ControlNetVersioner/ControlPointV0001.h +5 −4 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ namespace Isis { class Pvl; class PvlContainer; class ControlPointV0001 { public: Loading @@ -40,8 +41,8 @@ namespace Isis { private: // These are intentionally not implemented ControlPointV0001(); ControlPointV0001(const &ControlPointV0001 other); ControlPointV0001 &operator=(const &ControlPointV0001 other); ControlPointV0001(const ControlPointV0001 &other); ControlPointV0001 &operator=(const ControlPointV0001 &other); // methods for converting from Pvl to protobuf void copy(PvlContainer &container, Loading @@ -50,11 +51,11 @@ namespace Isis { void (ControlNetFileProtoV0001_PBControlPoint::*setter)(bool)); void copy(PvlContainer &container, QString keyName, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> &point, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(double)); void copy(PvlContainer &container, QString keyName, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> &point, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(const std::string&)); void copy(PvlContainer &container, QString keyName, Loading Loading
isis/src/control/objs/ControlNetVersioner/ControlPointV0001.cpp +24 −31 Original line number Diff line number Diff line Loading @@ -2,9 +2,14 @@ #include <QString> #include "ControlPointV0001.h" #include "ControlMeasureLogData.h" #include "Distance.h" #include "IException.h" #include "Latitude.h" #include "Longitude.h" #include "NaifStatus.h" #include "Pvl.h" #include "PvlContainer.h" #include "SurfacePoint.h" #include "Target.h" Loading Loading @@ -82,13 +87,13 @@ namespace Isis { else if ( pointObject.hasKeyword("X") && pointObject.hasKeyword("Y") && pointObject.hasKeyword("Z") ) { m_pointData->set_adjustedx( pointObject["Latitude"][0] ); m_pointData->set_adjustedy( pointObject["Longitude"][0] ); m_pointData->set_adjustedz( pointObject["Radius"][0] ); m_pointData->set_adjustedx( toDouble(pointObject["Latitude"][0]) ); m_pointData->set_adjustedy( toDouble(pointObject["Longitude"][0]) ); m_pointData->set_adjustedz( toDouble(pointObject["Radius"][0]) ); } else { QString msg = "Unable to find adjusted surface point values for the control point."; throw IException(e, IException::Io, msg, _FILEINFO_); throw IException(IException::Io, msg, _FILEINFO_); } // copy over the apriori surface point Loading @@ -114,7 +119,7 @@ namespace Isis { } else { QString msg = "Unable to find apriori surface point values for the control point."; throw IException(e, IException::Io, msg, _FILEINFO_); throw IException(IException::Io, msg, _FILEINFO_); } // Ground points were previously flagged by the Held keyword being true. Loading Loading @@ -318,7 +323,7 @@ namespace Isis { // Process Measures for (int groupIndex = 0; groupIndex < pointObject.groups(); groupIndex ++) { PvlGroup &group = pointObject.group(groupIndex); ControlNetFileProtoV0001_PBControlPoint::PBControlMeasure measure; ControlNetFileProtoV0001_PBControlPoint_PBControlMeasure measure; // Copy strings, booleans, and doubles copy(group, "SerialNumber", Loading Loading @@ -349,7 +354,7 @@ namespace Isis { if (group.hasKeyword("Sample")) { // The sample may not be a numeric value // in this case set it to 0 and ignore the measure double value double value; try { value = toDouble(group["Sample"][0]); } Loading @@ -357,13 +362,13 @@ namespace Isis { value = 0; m_pointData->set_ignore(true); } measure.measurement().set_sample(value); measure.mutable_measurement()->set_sample(value); group.deleteKeyword("Sample"); } if (group.hasKeyword("Line")) { // The line may not be a numeric value // in this case set it to 0 and ignore the measure double value double value; try { value = toDouble(group["Line"][0]); } Loading @@ -371,17 +376,17 @@ namespace Isis { value = 0; m_pointData->set_ignore(true); } measure.measurement().set_line(value); measure.mutable_measurement()->set_line(value); group.deleteKeyword("Line"); } if (group.hasKeyword("ErrorSample")) { double value = toDouble(group["ErrorSample"][0]); measure.measurement().set_sampleresidual(value); measure.mutable_measurement()->set_sampleresidual(value); group.deleteKeyword("ErrorSample"); } if (group.hasKeyword("ErrorLine")) { double value = toDouble(group["ErrorLine"][0]); measure.measurement().set_lineresidual(value); measure.mutable_measurement()->set_lineresidual(value); group.deleteKeyword("ErrorLine"); } Loading Loading @@ -428,18 +433,6 @@ namespace Isis { } } for (int key = 0; key < group.keywords(); key++) { ControlMeasureLogData interpreter(group[key]); if (!interpreter.IsValid()) { QString msg = "Unhandled or duplicate keywords in control measure [" + group[key].name() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); } else { *measure.add_log() = interpreter.ToProtocolBuffer(); } } *m_pointData->add_measures() = measure; } Loading Loading @@ -489,7 +482,7 @@ namespace Isis { value = value.toLower(); if (value == "true" || value == "yes") (point->*setter)(true); (point.data()->*setter)(true); } Loading @@ -509,7 +502,7 @@ namespace Isis { */ void ControlPointV0001::copy(PvlContainer &container, QString keyName, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> &point, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(double)) { if (!container.hasKeyword(keyName)) Loading @@ -517,7 +510,7 @@ namespace Isis { double value = toDouble(container[keyName][0]); container.deleteKeyword(keyName); (point->*setter)(value); (point.data()->*setter)(value); } Loading @@ -537,7 +530,7 @@ namespace Isis { */ void ControlPointV0001::copy(PvlContainer &container, QString keyName, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> &point, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(const std::string&)) { if (!container.hasKeyword(keyName)) Loading @@ -545,7 +538,7 @@ namespace Isis { QString value = container[keyName][0]; container.deleteKeyword(keyName); (point->*setter)(value); (point.data()->*setter)(value.toLatin1().data()); } Loading Loading @@ -633,6 +626,6 @@ namespace Isis { QString value = container[keyName][0]; container.deleteKeyword(keyName); (measure.*set)(value); (measure.*setter)(value.toLatin1().data()); } }
isis/src/control/objs/ControlNetVersioner/ControlPointV0001.h +5 −4 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ namespace Isis { class Pvl; class PvlContainer; class ControlPointV0001 { public: Loading @@ -40,8 +41,8 @@ namespace Isis { private: // These are intentionally not implemented ControlPointV0001(); ControlPointV0001(const &ControlPointV0001 other); ControlPointV0001 &operator=(const &ControlPointV0001 other); ControlPointV0001(const ControlPointV0001 &other); ControlPointV0001 &operator=(const ControlPointV0001 &other); // methods for converting from Pvl to protobuf void copy(PvlContainer &container, Loading @@ -50,11 +51,11 @@ namespace Isis { void (ControlNetFileProtoV0001_PBControlPoint::*setter)(bool)); void copy(PvlContainer &container, QString keyName, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> &point, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(double)); void copy(PvlContainer &container, QString keyName, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> &point, QSharedPointer<ControlNetFileProtoV0001_PBControlPoint> point, void (ControlNetFileProtoV0001_PBControlPoint::*setter)(const std::string&)); void copy(PvlContainer &container, QString keyName, Loading