Commit 628610b8 authored by Makayla Shepherd's avatar Makayla Shepherd
Browse files

Revert "Revert "Revert "Changed voy2isis to allow for ingestion of IMG/LBL...

Revert "Revert "Revert "Changed voy2isis to allow for ingestion of IMG/LBL pairs and Pds Archive images. Fixes #4345, #4421."""
parent c55ae102
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -807,7 +807,8 @@ namespace Isis {

    // Use the name supplied by the application if it is there
    if (pdsDataFile.length() > 0) {
      ProcessDataFilePointer(pdsXlater, false);
      SetInputFile(pdsDataFile);
      ProcessDataFilePointer(pdsXlater, true);
    }
    // If the data is in JPEG 2000 format, then use the name of the file
    // from the label
+0 −2
Original line number Diff line number Diff line
@@ -223,8 +223,6 @@ namespace Isis {
   *                          the default projection offsets and multipliers. Fixes #4887.
   *   @history 2017-12-20 Summer Stapleton - Modified error message in
   *                          ProcessImportPds::ProcessLabel() to be more discriptive. Fixes #4883.
   *   @history 2018-01-10 Christopher Combs - Changed ProcessDataFilePointer call to reflect 
   *                          reflect changes made to voy2isis. Fixes #4345, #4421.
   *
   */
  class ProcessImportPds : public ProcessImport {
+27 −38
Original line number Diff line number Diff line
@@ -148,32 +148,21 @@ namespace Isis {
    PvlKeyword key;

    int inst = 0;
     PvlGroup transGroup;
    PvlKeyword grp;

    while((grp = InputGroup(nName, inst++)).name() != "") {
      if((con = GetContainer(grp)) != NULL) {
         transGroup = TranslationTable().findGroup(nName);
         Pvl::ConstPvlKeywordIterator it = transGroup.findKeyword("InputKey",
                                           transGroup.begin(),
                                           transGroup.end());
         // Loop through potential InputKeys in the translation file group currently beginning
         // translated.
         while(it != transGroup.end()) {
           const PvlKeyword &result = *it;
           if(con->hasKeyword(result[0])) {
        if(con->hasKeyword(InputKeywordName(nName))) {
          key.setName(OutputName(nName));

             for(int v = 0; v < (*con)[(result[0])].size(); v++) {
          for(int v = 0; v < (*con)[(InputKeywordName(nName))].size(); v++) {
            key.addValue(PvlTranslationTable::Translate(nName,
                            (*con)[result[0]][v]),
                            (*con)[result[0]].unit(v));
                         (*con)[InputKeywordName(nName)][v]),
                         (*con)[InputKeywordName(nName)].unit(v));
          }

          return key;
        }
           it = transGroup.findKeyword("InputKey", it + 1, transGroup.end());
         }
      }
    }

@@ -220,7 +209,7 @@ namespace Isis {


  /**
   * Returns the ith input value associated with the output name argument.
   * Returns the ith input value assiciated with the output name argument.
   *
   * @param nName The output name used to identify the input keyword.
   *
+0 −2
Original line number Diff line number Diff line
@@ -75,8 +75,6 @@ namespace Isis {
   *                          parent class, LabelTranslationManager. Fixes #4584.
   *  @history 2017-06-13 Adam Paquette - Changed PvlTranslationManager file name to
   *                          PvlToPvlTranslationManager. Fixes #4901.
   *  @history 2018-01-10 Christopher Combs - Changed ProcessDataFilePointer call to reflect 
   *                          reflect changes made to voy2isis. Fixes #4345, #4421.
   *  @todo 2005-02-15 Stuart Sides - add coded example and implementation example
   *                                  to class documentation, and finish
   *                                  documentation
+14 −8
Original line number Diff line number Diff line
@@ -85,19 +85,26 @@ namespace Isis {
   */
  void PvlTranslationTable::AddTable(const QString &transFile) {
    p_trnsTbl.read(FileName(transFile).expanded());
    validateTable();
  }


  /**
   * Adds the contents of a translation table to the searchable groups/keys
   * Also performs a verification, to ensure that the translation table
   * is valid
   *
   * @param transStm The stream to be added.
   */
  void PvlTranslationTable::AddTable(std::istream &transStm) {
    transStm >> p_trnsTbl;
    validateTable();
  }


  /**
  * Performs verification to ensure that p_trnsTbl is valid
  *
  */
  void PvlTranslationTable::validateTable() {
    // pair< name, size > of acceptable keywords.
    // A size of -1 means non-zero size.
    vector< pair<QString, int> > validKeywordSizes = validKeywords();
@@ -193,7 +200,6 @@ namespace Isis {
   * Translates the output name and input value.
   *
   * @param nName The output name to be used to search the translation table.
   *
   * @param fValue The input value to be translated
   *
   * @return QString The translated QString
@@ -233,7 +239,9 @@ namespace Isis {

    while(it != tgrp.end()) {
      const PvlKeyword &key = *it;
      if((QString) key[1] == tmpFValue) {
      // compare the value from the input file to the second value of each Translation in the trans file.
      // ignore cases for input values
      if(QString::compare((QString) key[1], tmpFValue, Qt::CaseInsensitive) == 0) {
        return key[0];
      }
      else if((QString) key[1] == "*") {
@@ -354,9 +362,7 @@ namespace Isis {
    }

    PvlGroup tgrp = p_trnsTbl.findGroup(nName);
    if (tgrp.hasKeyword("InputKey")) {
      return tgrp["InputKey"];
    }
    if(tgrp.hasKeyword("InputKey")) return tgrp["InputKey"];

    return "";
  }
Loading