Commit 72ae8ee2 authored by Amy Stamile's avatar Amy Stamile
Browse files

PvlSequence updated

parent d229bf2e
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
#include "Statistics.h"
#include "Application.h"
#include "PvlGroup.h"
#include "PvlSequence.h"

using namespace std;
using namespace Isis;
+0 −1
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@
#include "Pvl.h"
#include "PvlGroup.h"
#include "PvlKeyword.h"
#include "PvlSequence.h"
#include "UserInterface.h"

using namespace std;
+6 −6
Original line number Diff line number Diff line
@@ -258,14 +258,14 @@ namespace Isis {
    seq = keyword;
    for (int i = 0; i < seq.Size(); i++) {
      // TODO:  Test array size to be 4 if not throw error
      std::vector<QString> array = seq[i];
      std::vector<std::string> array = seq[i];
      double et;
      utc2et_c(array[0].toLatin1().data(), &et);
      utc2et_c(array[0].c_str(), &et);
      p_time.push_back(et);
      p_a0.push_back(toDouble(array[1]));
      p_a1.push_back(toDouble(array[2]));
      p_a2.push_back(toDouble(array[3]));
      p_a3.push_back(toDouble(array[4]));
      p_a0.push_back(std::stod(array[1]));
      p_a1.push_back(std::stod(array[2]));
      p_a2.push_back(std::stod(array[3]));
      p_a3.push_back(std::stod(array[4]));
      // TODO:  Test that times are ordered if not throw error
      // Make the mrf2isis program sort them if necessary
    }
+4 −6
Original line number Diff line number Diff line
@@ -8,8 +8,6 @@ find files of those names at the top level of this repository. **/
/* SPDX-License-Identifier: CC0-1.0 */
#include <vector>

#include <QString>

#include "PvlKeyword.h"

namespace Isis {
@@ -53,16 +51,16 @@ namespace Isis {

      PvlSequence &operator=(PvlKeyword &key);

      PvlSequence &operator+=(const QString &array);
      PvlSequence &operator+=(const std::string array);

      PvlSequence &operator+=(std::vector<QString> &array);
      PvlSequence &operator+=(std::vector<std::string> &array);

      PvlSequence &operator+=(std::vector<int> &array);

      PvlSequence &operator+=(std::vector<double> &array);

      //! Return the ith Array of the sequence
      std::vector<QString> &operator[](int i) {
      std::vector<std::string> &operator[](int i) {
        return p_sequence[i];
      };

@@ -77,7 +75,7 @@ namespace Isis {
      };

    private:
      std::vector<std::vector<QString> > p_sequence; /**<A vector of Strings
      std::vector<std::vector<std::string> > p_sequence; /**<A vector of Strings
                                                        that contains the values
                                                        for the keyword. */

+5 −4
Original line number Diff line number Diff line
@@ -283,6 +283,7 @@ namespace Isis {
    }
  }


  /**
   * Adds a value with units.
   *
@@ -633,10 +634,10 @@ namespace Isis {
  PvlKeyword &PvlKeyword::operator=(Isis::PvlSequence &seq) {
    clear();
    for (int i = 0; i < seq.Size(); i++) {
      QString temp = "(";
      std::string temp = "(";
      for (int j = 0; j < (int)seq[i].size(); j++) {
        QString val = seq[i][j];
        if (val.contains(" ")) {
        std::string val = seq[i][j];
        if (val.find(" ") != std::string::npos) {
          temp += "\"" + val + "\"";
        }
        else {
@@ -645,7 +646,7 @@ namespace Isis {
        if (j < (int) seq[i].size() - 1) temp += ", ";
      }
      temp += ")";
      this->operator+=(temp);
      this->operator+=(QString::fromStdString(temp));
    }

    return *this;
Loading