Loading isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -807,8 +807,7 @@ namespace Isis { // Use the name supplied by the application if it is there if (pdsDataFile.length() > 0) { SetInputFile(pdsDataFile); ProcessDataFilePointer(pdsXlater, true); ProcessDataFilePointer(pdsXlater, false); } // If the data is in JPEG 2000 format, then use the name of the file // from the label Loading isis/src/base/objs/ProcessImportPds/ProcessImportPds.h +2 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,8 @@ 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 { Loading isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp +38 −27 Original line number Diff line number Diff line Loading @@ -148,21 +148,32 @@ namespace Isis { PvlKeyword key; int inst = 0; PvlGroup transGroup; PvlKeyword grp; while((grp = InputGroup(nName, inst++)).name() != "") { if((con = GetContainer(grp)) != NULL) { if(con->hasKeyword(InputKeywordName(nName))) { 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])) { key.setName(OutputName(nName)); for(int v = 0; v < (*con)[(InputKeywordName(nName))].size(); v++) { for(int v = 0; v < (*con)[(result[0])].size(); v++) { key.addValue(PvlTranslationTable::Translate(nName, (*con)[InputKeywordName(nName)][v]), (*con)[InputKeywordName(nName)].unit(v)); (*con)[result[0]][v]), (*con)[result[0]].unit(v)); } return key; } it = transGroup.findKeyword("InputKey", it + 1, transGroup.end()); } } } Loading Loading @@ -209,7 +220,7 @@ namespace Isis { /** * Returns the ith input value assiciated with the output name argument. * Returns the ith input value associated with the output name argument. * * @param nName The output name used to identify the input keyword. * Loading isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h +2 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,8 @@ 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 Loading isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp +8 −14 Original line number Diff line number Diff line Loading @@ -85,26 +85,19 @@ 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(); Loading Loading @@ -200,6 +193,7 @@ 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 Loading Loading @@ -239,9 +233,7 @@ namespace Isis { while(it != tgrp.end()) { const PvlKeyword &key = *it; // 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) { if((QString) key[1] == tmpFValue) { return key[0]; } else if((QString) key[1] == "*") { Loading Loading @@ -362,7 +354,9 @@ namespace Isis { } PvlGroup tgrp = p_trnsTbl.findGroup(nName); if(tgrp.hasKeyword("InputKey")) return tgrp["InputKey"]; if (tgrp.hasKeyword("InputKey")) { return tgrp["InputKey"]; } return ""; } Loading Loading
isis/src/base/objs/ProcessImportPds/ProcessImportPds.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -807,8 +807,7 @@ namespace Isis { // Use the name supplied by the application if it is there if (pdsDataFile.length() > 0) { SetInputFile(pdsDataFile); ProcessDataFilePointer(pdsXlater, true); ProcessDataFilePointer(pdsXlater, false); } // If the data is in JPEG 2000 format, then use the name of the file // from the label Loading
isis/src/base/objs/ProcessImportPds/ProcessImportPds.h +2 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,8 @@ 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 { Loading
isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.cpp +38 −27 Original line number Diff line number Diff line Loading @@ -148,21 +148,32 @@ namespace Isis { PvlKeyword key; int inst = 0; PvlGroup transGroup; PvlKeyword grp; while((grp = InputGroup(nName, inst++)).name() != "") { if((con = GetContainer(grp)) != NULL) { if(con->hasKeyword(InputKeywordName(nName))) { 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])) { key.setName(OutputName(nName)); for(int v = 0; v < (*con)[(InputKeywordName(nName))].size(); v++) { for(int v = 0; v < (*con)[(result[0])].size(); v++) { key.addValue(PvlTranslationTable::Translate(nName, (*con)[InputKeywordName(nName)][v]), (*con)[InputKeywordName(nName)].unit(v)); (*con)[result[0]][v]), (*con)[result[0]].unit(v)); } return key; } it = transGroup.findKeyword("InputKey", it + 1, transGroup.end()); } } } Loading Loading @@ -209,7 +220,7 @@ namespace Isis { /** * Returns the ith input value assiciated with the output name argument. * Returns the ith input value associated with the output name argument. * * @param nName The output name used to identify the input keyword. * Loading
isis/src/base/objs/PvlToPvlTranslationManager/PvlToPvlTranslationManager.h +2 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,8 @@ 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 Loading
isis/src/base/objs/PvlTranslationTable/PvlTranslationTable.cpp +8 −14 Original line number Diff line number Diff line Loading @@ -85,26 +85,19 @@ 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(); Loading Loading @@ -200,6 +193,7 @@ 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 Loading Loading @@ -239,9 +233,7 @@ namespace Isis { while(it != tgrp.end()) { const PvlKeyword &key = *it; // 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) { if((QString) key[1] == tmpFValue) { return key[0]; } else if((QString) key[1] == "*") { Loading Loading @@ -362,7 +354,9 @@ namespace Isis { } PvlGroup tgrp = p_trnsTbl.findGroup(nName); if(tgrp.hasKeyword("InputKey")) return tgrp["InputKey"]; if (tgrp.hasKeyword("InputKey")) { return tgrp["InputKey"]; } return ""; } Loading