Commit e5d19a9b authored by Jesse Mapel's avatar Jesse Mapel Committed by Makayla Shepherd
Browse files

made fixes in ControlPointV0001 so it would compile.

parent a842aace
Loading
Loading
Loading
Loading
+24 −31
Original line number Diff line number Diff line
@@ -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"

@@ -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
@@ -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.
@@ -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",
@@ -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]);
        }
@@ -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]);
        }
@@ -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");
      }

@@ -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;
    }

@@ -489,7 +482,7 @@ namespace Isis {
    value = value.toLower();

    if (value == "true" || value == "yes")
      (point->*setter)(true);
      (point.data()->*setter)(true);
  }


@@ -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))
@@ -517,7 +510,7 @@ namespace Isis {

    double value = toDouble(container[keyName][0]);
    container.deleteKeyword(keyName);
    (point->*setter)(value);
    (point.data()->*setter)(value);
  }


@@ -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))
@@ -545,7 +538,7 @@ namespace Isis {

    QString value = container[keyName][0];
    container.deleteKeyword(keyName);
    (point->*setter)(value);
    (point.data()->*setter)(value.toLatin1().data());
  }


@@ -633,6 +626,6 @@ namespace Isis {

    QString value = container[keyName][0];
    container.deleteKeyword(keyName);
    (measure.*set)(value);
    (measure.*setter)(value.toLatin1().data());
  }
}
+5 −4
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@

namespace Isis {
  class Pvl;
  class PvlContainer;

  class ControlPointV0001 {
    public:
@@ -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,
@@ -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,